mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-22 17:52:35 +00:00
Merge branch 'main' into small-fixes
This commit is contained in:
commit
c4cb9dc9bd
21
app.py
21
app.py
@ -683,15 +683,18 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
print("New backend selected")
|
print("New backend selected")
|
||||||
|
|
||||||
self.config['backend'] = backend
|
self.config['backend'] = backend
|
||||||
backend_ =self.process.load_backend(config["backend"])
|
try:
|
||||||
models = backend_.list_models(self.config)
|
backend_ =self.process.load_backend(config["backend"],True)
|
||||||
if len(models)>0:
|
models = backend_.list_models(self.config)
|
||||||
self.backend = backend_
|
if len(models)>0:
|
||||||
self.config['model'] = models[0]
|
self.backend = backend_
|
||||||
# Build chatbot
|
self.config['model'] = models[0]
|
||||||
return jsonify(self.process.set_config(self.config))
|
# Build chatbot
|
||||||
else:
|
return jsonify(self.process.set_config(self.config))
|
||||||
return jsonify({"status": "no_models_found"})
|
else:
|
||||||
|
return jsonify({"status": "no_models_found"})
|
||||||
|
except :
|
||||||
|
return jsonify({"status": "failed"})
|
||||||
|
|
||||||
return jsonify({"status": "error"})
|
return jsonify({"status": "error"})
|
||||||
|
|
||||||
|
@ -155,6 +155,10 @@ class ModelProcess:
|
|||||||
self.model = model_path
|
self.model = model_path
|
||||||
|
|
||||||
def set_config(self, config):
|
def set_config(self, config):
|
||||||
|
try:
|
||||||
|
self.set_config_result_queue.get_nowait()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.set_config_queue.put(config)
|
self.set_config_queue.put(config)
|
||||||
# Wait for it t o be consumed
|
# Wait for it t o be consumed
|
||||||
while self.set_config_result_queue.empty():
|
while self.set_config_result_queue.empty():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user