From a2d8347939a338adb5dc664149d77e46a5c30601 Mon Sep 17 00:00:00 2001 From: henk717 Date: Thu, 23 Dec 2021 03:05:53 +0100 Subject: [PATCH] Replace model path differently The path correction was applied to soon and broke online loading, applying the replace where it is relevant instead. --- aiserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiserver.py b/aiserver.py index 2c554174..4f51d299 100644 --- a/aiserver.py +++ b/aiserver.py @@ -393,7 +393,7 @@ if(not vars.model in ["InferKit", "Colab", "OAI", "ReadOnly", "TPUMeshTransforme # Make model path the same as the model name to make this consistent with the other loading method if it isn't a known model type # This code is not just a workaround for below, it is also used to make the behavior consistent with other loading methods - Henk717 if(not vars.model in ["NeoCustom", "GPT2Custom"]): - vars.custmodpth = vars.model.replace('/', '_') + vars.custmodpth = vars.model # Get the model_type from the config or assume a model type if it isn't present from transformers import AutoConfig try: @@ -1948,8 +1948,8 @@ def loadsettings(): # Allow the models to override some settings #==================================================================# def loadmodelsettings(): - if(path.exists(vars.custmodpth + "/config.json")): - model_config = open(vars.custmodpth + "/config.json", "r") + if(path.exists(vars.custmodpth.replace('/', '_') + "/config.json")): + model_config = open(vars.custmodpth.replace('/', '_') + "/config.json", "r") js = json.load(model_config) if("badwordsids" in js): vars.badwordsids = js["badwordsids"]