mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 04:17:52 +00:00
Bugfix: Model set and personality set errors
This commit is contained in:
parent
4c5b162a71
commit
5bdf39f102
12
app.py
12
app.py
@ -454,7 +454,10 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
|
||||
|
||||
def apply_settings(self):
|
||||
return jsonify(self.process.set_config(self.config))
|
||||
result = self.process.set_config(self.config)
|
||||
print("Set config results:")
|
||||
print(result)
|
||||
return jsonify(result)
|
||||
|
||||
def list_backends(self):
|
||||
backends_dir = Path('./backends') # replace with the actual path to the models folder
|
||||
@ -701,7 +704,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
# Build chatbot
|
||||
return jsonify(self.process.set_config(self.config))
|
||||
|
||||
return jsonify({"status": "error"})
|
||||
return jsonify({"status": "succeeded"})
|
||||
|
||||
def update_model_params(self):
|
||||
data = request.get_json()
|
||||
@ -716,7 +719,6 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
|
||||
self.config['backend'] = backend
|
||||
self.config['model'] = model
|
||||
self.process.set_config(self.config)
|
||||
|
||||
self.config['personality_language'] = personality_language
|
||||
self.config['personality_category'] = personality_category
|
||||
@ -739,7 +741,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
|
||||
save_config(self.config, self.config_file_path)
|
||||
|
||||
self.process.set_config(self.config)
|
||||
|
||||
# Fixed missing argument
|
||||
self.backend = self.process.rebuild_backend(self.config)
|
||||
|
||||
@ -761,7 +763,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
print(f"\trepeat_last_n:{self.config['repeat_last_n']}")
|
||||
print("==============================================")
|
||||
|
||||
return jsonify({"status":"ok"})
|
||||
return jsonify(self.process.set_config(self.config))
|
||||
|
||||
|
||||
def get_available_models(self):
|
||||
|
@ -179,8 +179,6 @@ class ModelProcess:
|
||||
print("Couldn't build backend.")
|
||||
print(ex)
|
||||
backend = None
|
||||
self._set_config_result['backend_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build backend:{ex}")
|
||||
return backend
|
||||
|
||||
def _rebuild_model(self):
|
||||
@ -200,16 +198,18 @@ class ModelProcess:
|
||||
print("Couldn't build model")
|
||||
print(ex)
|
||||
self.model = None
|
||||
self._set_config_result['model_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build model:{ex}")
|
||||
self._set_config_result['status'] ='failed'
|
||||
self._set_config_result['backend_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build backend:{ex}")
|
||||
except Exception as ex:
|
||||
traceback.print_exc()
|
||||
print("Couldn't build backend")
|
||||
print(ex)
|
||||
self.backend = None
|
||||
self.model = None
|
||||
self._set_config_result['model_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build model:{ex}")
|
||||
self._set_config_result['status'] ='failed'
|
||||
self._set_config_result['backend_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build backend:{ex}")
|
||||
|
||||
def rebuild_personality(self):
|
||||
try:
|
||||
@ -239,8 +239,9 @@ class ModelProcess:
|
||||
if self.config["debug"]:
|
||||
print(ex)
|
||||
self.personality = AIPersonality()
|
||||
self._set_config_result['personality_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't load personality:{ex}")
|
||||
self._set_config_result['status'] ='failed'
|
||||
self._set_config_result['backend_status'] ='failed'
|
||||
self._set_config_result['errors'].append(f"couldn't build backend:{ex}")
|
||||
|
||||
def step_callback(self, text, message_type):
|
||||
self.generation_queue.put((text,self.id, message_type))
|
||||
|
Loading…
Reference in New Issue
Block a user