From 70f1c2da9cd1a2125927358760a45de2b0d93e83 Mon Sep 17 00:00:00 2001 From: ebolam Date: Mon, 7 Mar 2022 14:20:25 -0500 Subject: [PATCH] Added stub for model name feedback --- aiserver.py | 3 +++ static/application.js | 4 ++++ templates/index.html | 13 +++++++++++++ 3 files changed, 20 insertions(+) diff --git a/aiserver.py b/aiserver.py index 0da4f2a2..ca3e51fe 100644 --- a/aiserver.py +++ b/aiserver.py @@ -2569,6 +2569,9 @@ def get_message(msg): f.write(msg['gpu_layers']) f.close() load_model(use_gpu=msg['use_gpu'], key=msg['key'], gpu_layers=msg['gpu_layers']) + elif(msg['cmd'] == 'show_model'): + print("Model Name: {}".format(getmodelname())) + emit('from_server', {'cmd': 'show_model_name', 'data': getmodelname()}, broadcast=True) elif(msg['cmd'] == 'selectmodel'): if msg['data'] in ('NeoCustom', 'GPT2Custom') and 'path' not in msg: sendModelSelection(menu=msg['data']) diff --git a/static/application.js b/static/application.js index 5fafa672..0c713f82 100644 --- a/static/application.js +++ b/static/application.js @@ -2420,6 +2420,10 @@ $(document).ready(function(){ } else if(msg.cmd == 'hide_layer_bar') { $("#modellayers").addClass("hidden"); enableButtons([load_model_accept]); + } else if(msg.cmd == 'show_model_name') { + $("#showmodelnamecontent").html("
" + msg.data + "
"); + $("#showmodelnamecontainer").removeClass("hidden"); + console.log(msg.data); } }); diff --git a/templates/index.html b/templates/index.html index b7524a17..9f535c35 100644 --- a/templates/index.html +++ b/templates/index.html @@ -319,6 +319,19 @@ +