diff --git a/app.py b/app.py index a7880864..bd419c86 100644 --- a/app.py +++ b/app.py @@ -284,6 +284,7 @@ class Gpt4AllWebUI(GPT4AllAPI): personalities[language_folder.name][category_folder.name].append(personality_info) return json.dumps(personalities) + # Settings (data: {"setting_name":,"setting_value":}) def update_setting(self): data = request.get_json() @@ -371,10 +372,11 @@ class Gpt4AllWebUI(GPT4AllAPI): elif setting_name== "backend": if self.config['backend']!= data['setting_value']: - print("New backend selected") + print(f"New backend selected : {data['setting_value']}") self.config["backend"]=data['setting_value'] try: - self.backend = self.process.load_backend(self.config["backend"]) + self.backend = self.process.load_backend(self.config["backend"], install=True) + except Exception as ex: print("Couldn't build backend") return jsonify({'setting_name': data['setting_name'], "status":False, 'error':str(ex)}) @@ -391,7 +393,7 @@ class Gpt4AllWebUI(GPT4AllAPI): if self.config["debug"]: print(f"Configuration {data['setting_name']} set to {data['setting_value']}") - print("Configuration updated") + print(f"Configuration {data['setting_name']} updated") # Tell that the setting was changed return jsonify({'setting_name': data['setting_name'], "status":True}) diff --git a/gpt4all_api/api.py b/gpt4all_api/api.py index abbf48d3..b3cac1f0 100644 --- a/gpt4all_api/api.py +++ b/gpt4all_api/api.py @@ -108,6 +108,10 @@ class ModelProcess: } def load_backend(self, backend_name:str, install=False): + if install: + print(f"Loading backend {backend_name} install ON") + else: + print(f"Loading backend : {backend_name} install is off") backend_path = Path("backends")/backend_name if install: # first find out if there is a requirements.txt file