From 04cf1851e6bc36625d44d6756c4af8817f093c0f Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 8 Sep 2022 17:22:06 -0400 Subject: [PATCH] Colab fix --- koboldai_settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index a985d0e7..5d75c023 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -35,7 +35,8 @@ def process_variable_changes(socketio, classname, name, value, old_value, debug_ #If we got a variable change from a thread other than what the app is run it, eventlet seems to block and no further messages are sent. Instead, we'll rely the message to the app and have the main thread send it if not has_request_context(): data = ["var_changed", {"classname": classname, "name": name, "old_value": clean_var_for_emit(old_value), "value": clean_var_for_emit(value)}, {"include_self":True, "broadcast":True, "room":"UI_2"}] - queue.put(data) + if queue is not None: + queue.put(data) else: socketio.emit("var_changed", {"classname": classname, "name": name, "old_value": clean_var_for_emit(old_value), "value": clean_var_for_emit(value)}, include_self=True, broadcast=True, room="UI_2")