Fix for green opening text showing OAI and/or OAI/GooseAI model name rather than the appropriate name.

This commit is contained in:
ebolam 2022-06-07 13:47:10 -04:00
parent 1df88e1696
commit 6fd2496d94
3 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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];

View File

@ -289,7 +289,7 @@
<input class="form-control hidden" type="text" placeholder="Enter the URL of the server (For example a trycloudflare link)" id="modelurl" onchange="check_enable_model_load()">
</div>
<div class="popupfooter">
<select class="form-control hidden" id="oaimodel"><option value="Select OAI Model">Select OAI Model</option></select>
<select class="form-control hidden" id="oaimodel"><option value="">Select OAI Model</option></select>
</div>
<div class="popupfooter hidden" id=modellayers>
<div class='settingitem' style="width:100%">