From 7df7e44d070e02c6ce03201660d5d25d02326fbd Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Thu, 6 Jul 2023 01:01:17 +0200 Subject: [PATCH] upgraded ui --- app.py | 16 ++++++++++++++- web/src/components/Message.vue | 12 ++++++++--- web/src/components/PersonalityEntry.vue | 2 +- web/src/views/DiscussionsView.vue | 7 ++++++- web/src/views/SettingsView.vue | 27 ++++++++++++++++++++++++- 5 files changed, 57 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index ed228636..30d0a2e0 100644 --- a/app.py +++ b/app.py @@ -126,6 +126,7 @@ class LoLLMsWebUI(LoLLMsAPPI): self.add_endpoint("/install_model_from_path", "install_model_from_path", self.install_model_from_path, methods=["GET"]) self.add_endpoint("/reinstall_binding", "reinstall_binding", self.reinstall_binding, methods=["POST"]) + self.add_endpoint("/reinstall_personality", "reinstall_personality", self.reinstall_personality, methods=["POST"]) self.add_endpoint("/switch_personal_path", "switch_personal_path", self.switch_personal_path, methods=["POST"]) @@ -864,14 +865,27 @@ class LoLLMsWebUI(LoLLMsAPPI): "status": True }) + def reinstall_personality(self): + try: + data = request.get_json() + # Further processing of the data + except Exception as e: + print(f"Error occurred while parsing JSON: {e}") + return jsonify({"status":False, 'error':str(e)}) + ASCIIColors.info(f"- Reinstalling personality {data['name']}...") + try: + ASCIIColors.info("Unmounting personality") + except Exception as e: + return jsonify({"status":False, 'error':str(e)}) + def reinstall_binding(self): try: data = request.get_json() # Further processing of the data except Exception as e: print(f"Error occurred while parsing JSON: {e}") - return jsonify({"status":False, 'error':str(ex)}) + return jsonify({"status":False, 'error':str(e)}) ASCIIColors.info(f"- Reinstalling binding {data['name']}...") try: ASCIIColors.info("Unmounting binding and model") diff --git a/web/src/components/Message.vue b/web/src/components/Message.vue index 9e856f40..a51f008f 100644 --- a/web/src/components/Message.vue +++ b/web/src/components/Message.vue @@ -117,6 +117,9 @@
+
+ +