mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix for abort
This commit is contained in:
19
aiserver.py
19
aiserver.py
@@ -918,17 +918,17 @@ def loadsettings():
|
||||
# Load a soft prompt from a file
|
||||
#==================================================================#
|
||||
|
||||
def check_for_sp_change():
|
||||
while(True):
|
||||
time.sleep(0.05)
|
||||
|
||||
if(koboldai_vars.sp_changed):
|
||||
with app.app_context():
|
||||
emit('from_server', {'cmd': 'spstatitems', 'data': {koboldai_vars.spfilename: koboldai_vars.spmeta} if koboldai_vars.allowsp and len(koboldai_vars.spfilename) else {}}, namespace=None, broadcast=True, room="UI_1")
|
||||
koboldai_vars.sp_changed = False
|
||||
#def check_for_sp_change():
|
||||
# while(True):
|
||||
# time.sleep(0.05)
|
||||
#
|
||||
# if(koboldai_vars.sp_changed):
|
||||
# with app.app_context():
|
||||
# emit('from_server', {'cmd': 'spstatitems', 'data': {koboldai_vars.spfilename: koboldai_vars.spmeta} if koboldai_vars.allowsp and len(koboldai_vars.spfilename) else {}}, namespace=None, broadcast=True, room="UI_1")
|
||||
# koboldai_vars.sp_changed = False
|
||||
|
||||
|
||||
socketio.start_background_task(check_for_sp_change)
|
||||
#socketio.start_background_task(check_for_sp_change)
|
||||
|
||||
def spRequest(filename):
|
||||
if(not koboldai_vars.allowsp):
|
||||
@@ -1798,6 +1798,7 @@ def patch_transformers():
|
||||
if(koboldai_vars.abort or koboldai_vars.generated_tkns >= koboldai_vars.genamt):
|
||||
self.regeneration_required = False
|
||||
self.halt = False
|
||||
koboldai_vars.abort = False
|
||||
return True
|
||||
if(koboldai_vars.standalone):
|
||||
return False
|
||||
|
@@ -317,7 +317,7 @@ class koboldai_vars(object):
|
||||
# return getattr(self._story_settings[self._sessions['story']], name)
|
||||
else:
|
||||
return getattr(self._story_settings['default'], name)
|
||||
|
||||
|
||||
|
||||
class settings(object):
|
||||
def to_json(self):
|
||||
@@ -796,9 +796,14 @@ class system_settings(settings):
|
||||
if name not in self.local_only_variables and name[0] != "_" and not new_variable:
|
||||
process_variable_changes(self.socketio, self.__class__.__name__.replace("_settings", ""), name, value, old_value)
|
||||
|
||||
if name == "aibusy" and value == False:
|
||||
koboldai_vars.abort = False
|
||||
|
||||
#if name == "aibusy" and value == False and self.abort == True:
|
||||
# koboldai_vars.abort = False
|
||||
|
||||
#for original UI
|
||||
if name == 'sp_changed':
|
||||
self.socketio.emit('from_server', {'cmd': 'spstatitems', 'data': {koboldai_vars.spfilename: koboldai_vars.spmeta} if koboldai_vars.allowsp and len(koboldai_vars.spfilename) else {}}, namespace=None, broadcast=True, room="UI_1")
|
||||
self.sp_changed = False
|
||||
|
||||
if name == 'horde_share':
|
||||
if self.on_colab == False:
|
||||
if os.path.exists("./KoboldAI-Horde"):
|
||||
|
@@ -1403,6 +1403,11 @@ body {
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.statusbar_outer[system_aibusy="false"] {
|
||||
display: none;
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
.statusbar_inner {
|
||||
background-color: var(--statusbar_color);
|
||||
color: var(--statusbar_text_color);
|
||||
|
@@ -80,7 +80,7 @@
|
||||
document.getElementById("themetext").value = "";
|
||||
}'
|
||||
onkeyup="calc_token_usage()"></textarea>
|
||||
<div class="statusbar_outer hidden" id="status_bar" onclick="socket.emit('abort','');">
|
||||
<div class="statusbar_outer hidden var_sync_alt_system_aibusy" id="status_bar" onclick="socket.emit('abort','');">
|
||||
<div class="statusbar_inner" style="width:0%" onclick="socket.emit('abort','');">0%</div>
|
||||
</div><br>
|
||||
<button type="button" class="btn action_button submit var_sync_alt_system_aibusy" system_aibusy=False id="btnsubmit"
|
||||
|
Reference in New Issue
Block a user