mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Added comregex_ui and comregex_ai to the UI under other settings. Needs proper titles and descriptions still.
This commit is contained in:
@@ -881,6 +881,38 @@ gensettingstf = [
|
|||||||
"classname": "system",
|
"classname": "system",
|
||||||
"name": "seed",
|
"name": "seed",
|
||||||
"extra_classes": "var_sync_alt_system_seed_specified",
|
"extra_classes": "var_sync_alt_system_seed_specified",
|
||||||
|
"ui_level": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uitype": "text",
|
||||||
|
"unit": "text",
|
||||||
|
"label": "comregex_ai_string",
|
||||||
|
"id": "comregex_ai_string",
|
||||||
|
"min": 0,
|
||||||
|
"max": 1,
|
||||||
|
"step": 1,
|
||||||
|
"default": 1,
|
||||||
|
"tooltip": "Pattern for matching comments to remove them before sending them to the AI.",
|
||||||
|
"menu_path": "Settings",
|
||||||
|
"sub_path": "Other",
|
||||||
|
"classname": "system",
|
||||||
|
"name": "comregex_ai_string",
|
||||||
|
"ui_level": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uitype": "text",
|
||||||
|
"unit": "text",
|
||||||
|
"label": "comregex_ui_string",
|
||||||
|
"id": "comregex_ui_string",
|
||||||
|
"min": 0,
|
||||||
|
"max": 1,
|
||||||
|
"step": 1,
|
||||||
|
"default": 1,
|
||||||
|
"tooltip": "Pattern for matching comments in the editor.",
|
||||||
|
"menu_path": "Settings",
|
||||||
|
"sub_path": "Other",
|
||||||
|
"classname": "system",
|
||||||
|
"name": "comregex_ui_string",
|
||||||
"ui_level": 2
|
"ui_level": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1203,9 +1203,9 @@ class undefined_settings(settings):
|
|||||||
|
|
||||||
class system_settings(settings):
|
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',
|
'sp', '_horde_pid', 'inference_config', 'image_pipeline',
|
||||||
'summarizer', 'summary_tokenizer', 'tts_model', 'rng_states', 'comregex_ai', 'comregex_ui']
|
'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',
|
||||||
@@ -1252,8 +1252,10 @@ class system_settings(settings):
|
|||||||
self.regex_sl = re.compile(r'\n*(?<=.) *\n(.|\n)*') # Pattern for limiting the output to a single line
|
self.regex_sl = re.compile(r'\n*(?<=.) *\n(.|\n)*') # Pattern for limiting the output to a single line
|
||||||
self.acregex_ai = re.compile(r'\n* *>(.|\n)*') # Pattern for matching adventure actions from the AI so we can remove them
|
self.acregex_ai = re.compile(r'\n* *>(.|\n)*') # Pattern for matching adventure actions from the AI so we can remove them
|
||||||
self.acregex_ui = re.compile(r'^ *(>.*)$', re.MULTILINE) # Pattern for matching actions in the HTML-escaped story so we can apply colouring, etc (make sure to encase part to format in parentheses)
|
self.acregex_ui = re.compile(r'^ *(>.*)$', re.MULTILINE) # Pattern for matching actions in the HTML-escaped story so we can apply colouring, etc (make sure to encase part to format in parentheses)
|
||||||
self.comregex_ai = re.compile(r'(?:\n\[<\|(?:.|\n)*?\|>\](?=\n|$))|(?:\[<\|(?:.|\n)*?\|>\]\n?)') # Pattern for matching comments to remove them before sending them to the AI
|
self.comregex_ai_string = '(?:\n\[<\|(?:.|\n)*?\|>\](?=\n|$))|(?:\[<\|(?:.|\n)*?\|>\]\n?)' # Pattern for matching comments to remove them before sending them to the AI
|
||||||
self.comregex_ui = re.compile(r'(\[<\|(?:.|\n)*?\|>\])') # Pattern for matching comments in the editor
|
self.comregex_ui_string = '(\[<\|(?:.|\n)*?\|>\])' # Pattern for matching comments in the editor
|
||||||
|
self.comregex_ai = re.compile(self.comregex_ai_string) # Pattern for matching comments to remove them before sending them to the AI
|
||||||
|
self.comregex_ui = re.compile(self.comregex_ui_string) # Pattern for matching comments in the editor
|
||||||
self.host = False
|
self.host = False
|
||||||
self.flaskwebgui = False
|
self.flaskwebgui = False
|
||||||
self.quiet = False # If set will suppress any story text from being printed to the console (will only be seen on the client web page)
|
self.quiet = False # If set will suppress any story text from being printed to the console (will only be seen on the client web page)
|
||||||
@@ -1340,6 +1342,12 @@ class system_settings(settings):
|
|||||||
self._socketio.emit('from_server', {'cmd': 'spstatitems', 'data': {self.spfilename: self.spmeta} if self.allowsp and len(self.spfilename) else {}}, namespace=None, broadcast=True, room="UI_1")
|
self._socketio.emit('from_server', {'cmd': 'spstatitems', 'data': {self.spfilename: self.spmeta} if self.allowsp and len(self.spfilename) else {}}, namespace=None, broadcast=True, room="UI_1")
|
||||||
super().__setattr__("sp_changed", False)
|
super().__setattr__("sp_changed", False)
|
||||||
|
|
||||||
|
if name == 'comregex_ai_string':
|
||||||
|
self.comregex_ai = re.compile(self.comregex_ai_string)
|
||||||
|
|
||||||
|
if name == 'comregex_ui_string':
|
||||||
|
self.comregex_ui = re.compile(self.comregex_ui_string)
|
||||||
|
|
||||||
if name == 'keep_img_gen_in_memory' and value == False:
|
if name == 'keep_img_gen_in_memory' and value == False:
|
||||||
self.image_pipeline = None
|
self.image_pipeline = None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user