summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/js/chat.v2.js18
-rw-r--r--g4f/gui/server/backend.py1
2 files changed, 12 insertions, 7 deletions
diff --git a/g4f/gui/client/js/chat.v2.js b/g4f/gui/client/js/chat.v2.js
index 03c3a87a..5c1cbca8 100644
--- a/g4f/gui/client/js/chat.v2.js
+++ b/g4f/gui/client/js/chat.v2.js
@@ -597,15 +597,21 @@ observer.observe(message_input, { attributes: true });
const load_models = async () => {
- response = await fetch('/backend-api/v2/models')
- models = await response.json()
+ models = localStorage.getItem('_models')
- var MODELS_SELECT = document.getElementById('model');
+ if (models === null) {
+ response = await fetch('/backend-api/v2/models')
+ models = await response.json()
+ localStorage.setItem('_models', JSON.stringify(models))
+
+ } else {
+ models = JSON.parse(models)
+ }
- for (model of models) {
+ let MODELS_SELECT = document.getElementById('model');
- // Create new option elements
- var model_info = document.createElement('option');
+ for (model of models) {
+ let model_info = document.createElement('option');
model_info.value = model
model_info.text = model
diff --git a/g4f/gui/server/backend.py b/g4f/gui/server/backend.py
index 714609f6..e2c445a5 100644
--- a/g4f/gui/server/backend.py
+++ b/g4f/gui/server/backend.py
@@ -27,7 +27,6 @@ class Backend_Api:
def models(self):
models = g4f._all_models
- models.remove('oasst-sft-4-pythia-12b-epoch-3.5')
return models