Softprompt bug fix

This commit is contained in:
ebolam
2022-08-29 12:35:56 -04:00
parent 04ce534fd3
commit 2ed9cb4db2

View File

@@ -6571,7 +6571,8 @@ def final_startup():
file = open("settings/" + getmodelname().replace('/', '_') + ".settings", "r")
js = json.load(file)
if(koboldai_vars.allowsp and "softprompt" in js and type(js["softprompt"]) is str and all(q not in js["softprompt"] for q in ("..", ":")) and (len(js["softprompt"]) != 0 and all(js["softprompt"][0] not in q for q in ("/", "\\")))):
spRequest("softprompts/"+js["softprompt"])
if valid_softprompt("softprompts/"+js["softprompt"]):
spRequest("softprompts/"+js["softprompt"])
else:
koboldai_vars.spfilename = ""
file.close()