Merge pull request #304 from YellowRoseCx/united-yr

added local rng_states variable and fixed minor typo
This commit is contained in:
henk717
2023-03-13 22:46:00 +01:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -825,7 +825,7 @@ gensettingstf = [
"max": 1, "max": 1,
"step": 1, "step": 1,
"default": 0, "default": 0,
"tooltip": "If enabled a specfic seed will be used for the random generator on text generation", "tooltip": "If enabled, a specific seed will be used for the random generator on text generation",
"menu_path": "Settings", "menu_path": "Settings",
"sub_path": "Other", "sub_path": "Other",
"classname": "system", "classname": "system",

View File

@@ -1202,12 +1202,12 @@ class system_settings(settings):
local_only_variables = ['lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold', local_only_variables = ['lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold',
'lua_koboldcore', 'regex_sl', 'acregex_ai', 'acregex_ui', 'comregex_ai', 'lua_koboldcore', 'regex_sl', 'acregex_ai', 'acregex_ui', 'comregex_ai',
'comregex_ui', 'sp', '_horde_pid', 'inference_config', 'image_pipeline', 'comregex_ui', 'sp', '_horde_pid', 'inference_config', 'image_pipeline',
'summarizer', 'summary_tokenizer', 'tts_model'] 'summarizer', 'summary_tokenizer', 'tts_model', 'rng_states']
no_save_variables = ['lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold', no_save_variables = ['lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold',
'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy', 'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy',
'serverstarted', 'inference_config', 'image_pipeline', 'summarizer', 'serverstarted', 'inference_config', 'image_pipeline', 'summarizer',
'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model', 'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model',
'generating_image', 'bit_8_available', 'host', 'hascuda', 'usegpu'] 'generating_image', 'bit_8_available', 'host', 'hascuda', 'usegpu', 'rng_states']
settings_name = "system" settings_name = "system"
def __init__(self, socketio, koboldai_var): def __init__(self, socketio, koboldai_var):
self._socketio = socketio self._socketio = socketio
@@ -1263,6 +1263,7 @@ class system_settings(settings):
self.disable_output_formatting = False self.disable_output_formatting = False
self.full_determinism = False # Whether or not full determinism is enabled self.full_determinism = False # Whether or not full determinism is enabled
self.seed_specified = False # Whether or not the current RNG seed was specified by the user (in their settings file) self.seed_specified = False # Whether or not the current RNG seed was specified by the user (in their settings file)
self.rng_states = {} # creates an empty dictionary to store the random number generator (RNG) states for a given seed, which is used to restore the RNG state later on
self.seed = None # The current RNG seed (as an int), or None if unknown self.seed = None # The current RNG seed (as an int), or None if unknown
self.alt_gen = False # Use the calc_ai_text method for generating text to go to the AI self.alt_gen = False # Use the calc_ai_text method for generating text to go to the AI
self.theme_list = [".".join(f.split(".")[:-1]) for f in os.listdir("./themes") if os.path.isfile(os.path.join("./themes", f))] self.theme_list = [".".join(f.split(".")[:-1]) for f in os.listdir("./themes") if os.path.isfile(os.path.join("./themes", f))]