diff --git a/aiserver.py b/aiserver.py index 53a7024a..b61f7bb1 100644 --- a/aiserver.py +++ b/aiserver.py @@ -4042,6 +4042,8 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False, koboldai_vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", koboldai_vars.submission) # Remove trailing whitespace, excluding newlines data = koboldai_vars.submission if(not force_submit and len(data.strip()) == 0): + set_aibusy(0) + socketio.emit("error", "No prompt or random story theme entered", broadcast=True, room="UI_2") assert False # Start the game koboldai_vars.gamestarted = True @@ -7096,7 +7098,9 @@ def UI_2_submit(data): #==================================================================# @socketio.on('abort') def UI_2_abort(data): + print("got abort") koboldai_vars.abort = True + print(koboldai_vars.abort) #==================================================================# diff --git a/koboldai_settings.py b/koboldai_settings.py index 43073bff..08991be5 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -366,7 +366,7 @@ class settings(object): class model_settings(settings): local_only_variables = ['badwordsids', 'apikey', 'tqdm', 'socketio', 'default_preset'] no_save_variables = ['tqdm', 'tqdm_progress', 'tqdm_rem_time', 'socketio', 'modelconfig', 'custmodpth', 'generated_tkns', - 'loaded_layers', 'total_layers', 'total_download_chunks', 'downloaded_chunks'] + 'loaded_layers', 'total_layers', 'total_download_chunks', 'downloaded_chunks', 'presets', 'default_preset'] settings_name = "model" def __init__(self, socketio): self.socketio = socketio @@ -733,9 +733,14 @@ class system_settings(settings): def __setattr__(self, name, value): + if name == "abort": + print("setting abort") new_variable = name not in self.__dict__ old_value = getattr(self, name, None) super().__setattr__(name, value) + if name == "abort": + print("set abort to {}".format(self.abort)) + #Put variable change actions here if name == 'serverstarted': global serverstarted @@ -744,7 +749,11 @@ class system_settings(settings): process_variable_changes(self.socketio, self.__class__.__name__.replace("_settings", ""), name, value, old_value) if name == "aibusy" and value == False: + print("resetting abort as AI busy was set to false") koboldai_vars.abort = False + + if name == "abort": + print("set abort to {}".format(self.abort)) class KoboldStoryRegister(object): def __init__(self, socketio, story_settings, koboldai_vars, tokenizer=None, sequence=[]): diff --git a/templates/index_new.html b/templates/index_new.html index f21e54f8..b8f3efd1 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -41,13 +41,13 @@
-                        -                        -                        -                        -                        -                        -                        +                          +                          +                          +                          +                          +                          +                         
@@ -71,7 +71,7 @@