Bugfix: Check for keys in client.settings before attempting to access

This commit is contained in:
KoboldAI Dev 2021-05-10 09:26:31 -04:00
parent ba1ba0fc8a
commit 739a8a5268
1 changed files with 14 additions and 10 deletions

View File

@ -401,15 +401,19 @@ def loadsettings():
js = json.load(file)
# Copy file contents to vars
#for set in js:
# vars[set] = js[set]
vars.apikey = js["apikey"]
if("andepth" in js):
vars.andepth = js["andepth"]
if("temp" in js):
vars.temp = js["temp"]
if("top_p" in js):
vars.top_p = js["top_p"]
if("rep_pen" in js):
vars.rep_pen = js["rep_pen"]
if("genamt" in js):
vars.genamt = js["genamt"]
if("max_length" in js):
vars.max_length = js["max_length"]
if("ikgen" in js):
vars.ikgen = js["ikgen"]
file.close()