diff --git a/app.py b/app.py index 5de1e571..4d725104 100644 --- a/app.py +++ b/app.py @@ -302,7 +302,7 @@ class Gpt4AllWebUI(GPT4AllAPI): print("New backend selected") self.config["backend"]=data['setting_value'] - backend_, model_ =self.process.rebuild_model(self.config) + backend_ =self.process.rebuild_backend(self.config) models = backend_.list_models(self.config) if len(models)>0: self.backend = backend_ @@ -589,7 +589,7 @@ class Gpt4AllWebUI(GPT4AllAPI): save_config(self.config, self.config_file_path) self.process.set_config(self.config) - self.backend, self.model = self.process.rebuild_model() + self.backend = self.process.rebuild_backend() print("==============================================") print("Parameters changed to:") diff --git a/pyGpt4All/api.py b/pyGpt4All/api.py index 24706ee8..a9ee63d6 100644 --- a/pyGpt4All/api.py +++ b/pyGpt4All/api.py @@ -84,23 +84,15 @@ class ModelProcess: def clear_queue(self): self.clear_queue_queue.put(('clear_queue',)) - def rebuild_model(self, config): + def rebuild_backend(self, config): try: backend = self.load_backend(Path("backends")/config["backend"]) print("Backend loaded successfully") - try: - model = backend(config) - print("Model created successfully") - except Exception as ex: - print("Couldn't build model") - print(ex) - model = None except Exception as ex: print("Couldn't build backend") print(ex) backend = None - model = None - return backend, model + return backend def _rebuild_model(self): try: @@ -257,7 +249,7 @@ class GPT4AllAPI(): self.process.start() self.config = config - self.backend, self.model = self.process.rebuild_model(self.config) + self.backend = self.process.rebuild_backend(self.config) self.personality = self.process.rebuild_personality() if config["debug"]: print(print(f"{self.personality}")) @@ -442,7 +434,7 @@ class GPT4AllAPI(): timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") # Chatbot conditionning - self.condition_chatbot(self.personality.personality_conditioning) + self.condition_chatbot() return timestamp def prepare_query(self, message_id=-1): diff --git a/web/src/components/ModelEntry.vue b/web/src/components/ModelEntry.vue index c0c76d23..4370d963 100644 --- a/web/src/components/ModelEntry.vue +++ b/web/src/components/ModelEntry.vue @@ -86,7 +86,7 @@ export default { handleSelection() { if (this.isInstalled && !this.selected) { this.onSelected(this); - this.selected=true; + this.$set(this, 'selected', true); } } }