Bugfixes for personality changes

This commit is contained in:
Saifeddine ALOUI 2023-04-15 13:37:42 +02:00
parent 072f860bb7
commit b191106863

5
app.py
View File

@ -321,11 +321,16 @@ class Gpt4AllWebUI(GPT4AllAPI):
def update_model_params(self):
data = request.get_json()
model = str(data["model"])
personality = str(data["personality"])
if self.config['model'] != model:
print("New model selected")
self.config['model'] = model
self.create_chatbot()
if self.config['personality']!=data["personality"]:
self.config['personality'] = data["personality"]
self.personality = load_config(f"personalities/{self.config['personality']}.yaml")
self.config['n_predict'] = int(data["nPredict"])
self.config['seed'] = int(data["seed"])
self.config['model'] = str(data["model"])