From 4371de2c117d99c7be63aeee240d9c5868469fe3 Mon Sep 17 00:00:00 2001 From: YellowRoseCx <80486540+YellowRoseCx@users.noreply.github.com> Date: Wed, 8 Mar 2023 15:35:55 -0600 Subject: [PATCH 1/2] added rng_states variable added rng_states variable to fix an error caused by passing a seed through the API without having a seed already in use --- koboldai_settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index e921b307..300cd658 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1202,12 +1202,12 @@ class system_settings(settings): local_only_variables = ['lua_state', 'lua_logname', 'lua_koboldbridge', 'lua_kobold', 'lua_koboldcore', 'regex_sl', 'acregex_ai', 'acregex_ui', 'comregex_ai', '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', 'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy', 'serverstarted', 'inference_config', 'image_pipeline', 'summarizer', '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" def __init__(self, socketio, koboldai_var): self._socketio = socketio @@ -1263,6 +1263,7 @@ class system_settings(settings): self.disable_output_formatting = False 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.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.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))] From c5607110ee47ae3b68c340a6056c8843b035d767 Mon Sep 17 00:00:00 2001 From: YellowRoseCx <80486540+YellowRoseCx@users.noreply.github.com> Date: Wed, 8 Mar 2023 15:36:30 -0600 Subject: [PATCH 2/2] typo fix fixed typo of "specfic" to "specific" --- gensettings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensettings.py b/gensettings.py index 5b1dea42..863a2ba5 100644 --- a/gensettings.py +++ b/gensettings.py @@ -825,7 +825,7 @@ gensettingstf = [ "max": 1, "step": 1, "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", "sub_path": "Other", "classname": "system",