Universal Model Settings
No longer depends on a local config file enabling the configuration to work in --colab mode.
This commit is contained in:
parent
c25e2a33f1
commit
9532b56cb8
|
@ -2259,9 +2259,8 @@ def loadsettings():
|
||||||
# Allow the models to override some settings
|
# Allow the models to override some settings
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def loadmodelsettings():
|
def loadmodelsettings():
|
||||||
if(path.exists(vars.custmodpth.replace('/', '_') + "/config.json")):
|
model_js_config = str(model_config).partition(' ')[2]
|
||||||
model_config = open(vars.custmodpth.replace('/', '_') + "/config.json", "r")
|
js = json.loads(model_js_config)
|
||||||
js = json.load(model_config)
|
|
||||||
if("badwordsids" in js):
|
if("badwordsids" in js):
|
||||||
vars.badwordsids = js["badwordsids"]
|
vars.badwordsids = js["badwordsids"]
|
||||||
if("temp" in js):
|
if("temp" in js):
|
||||||
|
@ -2286,7 +2285,6 @@ def loadmodelsettings():
|
||||||
vars.setauthornotetemplate = js["antemplate"]
|
vars.setauthornotetemplate = js["antemplate"]
|
||||||
if(not vars.gamestarted):
|
if(not vars.gamestarted):
|
||||||
vars.authornotetemplate = vars.setauthornotetemplate
|
vars.authornotetemplate = vars.setauthornotetemplate
|
||||||
model_config.close()
|
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
# Don't save settings unless 2 seconds have passed without modification
|
# Don't save settings unless 2 seconds have passed without modification
|
||||||
|
@ -4552,7 +4550,8 @@ def randomGameRequest(topic, memory=""):
|
||||||
actionsubmit("", force_submit=True, force_prompt_gen=True)
|
actionsubmit("", force_submit=True, force_prompt_gen=True)
|
||||||
vars.memory = memory
|
vars.memory = memory
|
||||||
|
|
||||||
# Load settings from client.settings
|
# Load desired settings from both the model and the users config file
|
||||||
|
if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly", "TPUMeshTransformerGPTJ"]):
|
||||||
loadmodelsettings()
|
loadmodelsettings()
|
||||||
loadsettings()
|
loadsettings()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue