diff --git a/aiserver.py b/aiserver.py index 5827b96a..54346eb9 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1125,9 +1125,10 @@ def load_model(use_gpu=True, gpu_layers=None, initial_load=False, online_model=" if(vars.model == "GooseAI"): vars.oaiengines = "https://api.goose.ai/v1/engines" vars.model = "OAI" - args.configname = "GooseAI" + args.configname = "GooseAI" + "/" + online_model + else: + args.configname = vars.model + "/" + online_model vars.oaiurl = vars.oaiengines + "/{0}/completions".format(online_model) - args.configname = vars.model + "/" + online_model # If transformers model was selected & GPU available, ask to use CPU or GPU if(vars.model not in ["InferKit", "Colab", "OAI", "GooseAI" , "ReadOnly", "TPUMeshTransformerGPTJ", "TPUMeshTransformerGPTNeoX"]): @@ -1926,6 +1927,9 @@ def load_model(use_gpu=True, gpu_layers=None, initial_load=False, online_model=" set_aibusy(False) emit('from_server', {'cmd': 'hide_model_name'}, broadcast=True) time.sleep(0.1) + + if not vars.gamestarted: + setStartState() # Set up Flask routes diff --git a/static/application.js b/static/application.js index b68db36d..cfdd42ac 100644 --- a/static/application.js +++ b/static/application.js @@ -2480,11 +2480,13 @@ $(document).ready(function(){ } else if(msg.cmd == 'selected_model_info') { enableButtons([load_model_accept]); $("#oaimodel").addClass("hidden") + $("#oaimodel")[0].options[0].selected = true; if (msg.key) { $("#modelkey").removeClass("hidden"); $("#modelkey")[0].value = msg.key_value; } else { $("#modelkey").addClass("hidden"); + } if (msg.url) { $("#modelurl").removeClass("hidden"); @@ -2513,6 +2515,10 @@ $(document).ready(function(){ } else if(msg.cmd == 'oai_engines') { $("#oaimodel").removeClass("hidden") selected_item = 0; + length = $("#oaimodel")[0].options.length; + for (let i = 0; i < length; i++) { + $("#oaimodel")[0].options.remove(1); + } msg.data.forEach(function (item, index) { var option = document.createElement("option"); option.value = item[0]; diff --git a/templates/index.html b/templates/index.html index d300056a..648fef27 100644 --- a/templates/index.html +++ b/templates/index.html @@ -289,7 +289,7 @@