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