Fix for cluster key saving

This commit is contained in:
ebolam 2022-08-31 15:46:08 -04:00
parent b07a649e3e
commit 8626debeff
1 changed files with 3 additions and 0 deletions

View File

@ -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))