upgraded ui

This commit is contained in:
Saifeddine ALOUI 2023-06-14 10:06:38 +02:00
parent 86d3448829
commit 74a5d4e73d
5 changed files with 15 additions and 10 deletions

14
app.py
View File

@ -477,7 +477,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
if self.config["debug"]: if self.config["debug"]:
print(f"Configuration {data['setting_name']} set to {data['setting_value']}") print(f"Configuration {data['setting_name']} set to {data['setting_value']}")
print(f"Configuration {data['setting_name']} updated") ASCIIColors.success(f"Configuration {data['setting_name']} updated")
# Tell that the setting was changed # Tell that the setting was changed
return jsonify({'setting_name': data['setting_name'], "status":True}) return jsonify({'setting_name': data['setting_name'], "status":True})
@ -724,7 +724,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
def mount_personality(self): def mount_personality(self):
print("- Mounting personality") print("- Mounting personality ...",end="")
try: try:
data = request.get_json() data = request.get_json()
# Further processing of the data # Further processing of the data
@ -743,16 +743,18 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.mounted_personalities = self.process.rebuild_personalities() self.mounted_personalities = self.process.rebuild_personalities()
self.personality = self.mounted_personalities[self.config["active_personality_id"]] self.personality = self.mounted_personalities[self.config["active_personality_id"]]
self.apply_settings() self.apply_settings()
ASCIIColors.success("ok")
return jsonify({"status": True, return jsonify({"status": True,
"personalities":self.config["personalities"], "personalities":self.config["personalities"],
"active_personality_id":self.config["active_personality_id"] "active_personality_id":self.config["active_personality_id"]
}) })
else: else:
pth = str(config_file).replace('\\','/') pth = str(config_file).replace('\\','/')
ASCIIColors.error(f"nok : Personality not found @ {pth}")
return jsonify({"status": False, "error":f"Personality not found @ {pth}"}) return jsonify({"status": False, "error":f"Personality not found @ {pth}"})
def unmount_personality(self): def unmount_personality(self):
print("- Unmounting personality") print("- Unmounting personality ...",end="")
try: try:
data = request.get_json() data = request.get_json()
# Further processing of the data # Further processing of the data
@ -774,27 +776,33 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.personalities = [] self.personalities = []
self.personality = None self.personality = None
self.apply_settings() self.apply_settings()
ASCIIColors.success("ok")
return jsonify({ return jsonify({
"status": True, "status": True,
"personalities":self.config["personalities"], "personalities":self.config["personalities"],
"active_personality_id":self.config["active_personality_id"] "active_personality_id":self.config["active_personality_id"]
}) })
except: except:
ASCIIColors.error(f"nok : Personality not found @ {pth}")
return jsonify({"status": False, "error":"Couldn't unmount personality"}) return jsonify({"status": False, "error":"Couldn't unmount personality"})
def select_personality(self): def select_personality(self):
print("- Selecting active personality ...",end="")
data = request.get_json() data = request.get_json()
id = data['id'] id = data['id']
if id<len(self.config["personalities"]): if id<len(self.config["personalities"]):
self.config["active_personality_id"]=id self.config["active_personality_id"]=id
self.personality = self.mounted_personalities[self.config["active_personality_id"]] self.personality = self.mounted_personalities[self.config["active_personality_id"]]
self.apply_settings() self.apply_settings()
ASCIIColors.success("ok")
return jsonify({ return jsonify({
"status": True, "status": True,
"personalities":self.config["personalities"], "personalities":self.config["personalities"],
"active_personality_id":self.config["active_personality_id"] "active_personality_id":self.config["active_personality_id"]
}) })
else: else:
ASCIIColors.error(f"nok : Personality not found @ {pth}")
return jsonify({"status": False, "error":"Invalid ID"}) return jsonify({"status": False, "error":"Invalid ID"})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GPT4All - WEBUI</title> <title>GPT4All - WEBUI</title>
<script type="module" crossorigin src="/assets/index-90e5688b.js"></script> <script type="module" crossorigin src="/assets/index-15f764ca.js"></script>
<link rel="stylesheet" href="/assets/index-7fdd6f06.css"> <link rel="stylesheet" href="/assets/index-b23f444b.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -232,9 +232,6 @@
<h3 class="font-bold font-large text-lg line-clamp-1"> <h3 class="font-bold font-large text-lg line-clamp-1">
{{ configFile.model_name }} {{ configFile.model_name }}
</h3> </h3>
<button @click.stop="showAddModelDialog" class="text-base hover:text-primary-dark ml-1 bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-dark-tone duration-200 rounded-lg px-2 py-1">
+
</button>
</div> </div>
</div> </div>
</div> </div>