From 8626debeff3416f6997d3f63652f2ac2bacff19b Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 31 Aug 2022 15:46:08 -0400 Subject: [PATCH] Fix for cluster key saving --- aiserver.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aiserver.py b/aiserver.py index 2f040cd0..f8435737 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1570,6 +1570,7 @@ def get_oai_models(key): else: changed=True if changed: + js={} with open("settings/{}.settings".format(vars.model_selected), "w") as file: js["apikey"] = key file.write(json.dumps(js, indent=3)) @@ -1583,6 +1584,7 @@ def get_oai_models(key): def get_cluster_models(msg): vars.oaiapikey = msg['key'] + vars.apikey = vars.oaiapikey url = msg['url'] @@ -1618,6 +1620,7 @@ def get_cluster_models(msg): else: changed=True if changed: + js={} with open("settings/{}.settings".format(vars.model_selected), "w") as file: js["apikey"] = vars.oaiapikey file.write(json.dumps(js, indent=3))