Merge pull request #266 from ParisNeo/lollms

Lollms
This commit is contained in:
Saifeddine ALOUI 2023-06-10 16:05:44 +02:00 committed by GitHub
commit 66e5a7ade0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

13
app.py
View File

@ -741,11 +741,11 @@ class LoLLMsWebUI(LoLLMsAPPI):
name = data['name']
package_path = f"{language}/{category}/{name}"
package_full_path = self.lollms_paths.lollms_path/"personalities_zoo"/package_path
package_full_path = self.lollms_paths.personalities_zoo_path/package_path
config_file = package_full_path / "config.yaml"
if config_file.exists():
self.config["personalities"].append(package_path)
self.personalities = self.process.rebuild_personalities()
self.mounted_personalities = self.process.rebuild_personalities()
self.personality = self.mounted_personalities[self.config["active_personality_id"]]
self.apply_settings()
return jsonify({"status": True,
@ -788,12 +788,17 @@ class LoLLMsWebUI(LoLLMsAPPI):
return jsonify({"status": False, "error":"Couldn't unmount personality"})
def select_personality(self):
id = request.files['id']
data = request.get_json()
id = data['id']
if id<len(self.config["personalities"]):
self.config["active_personality_id"]=id
self.personality = self.mounted_personalities[self.config["active_personality_id"]]
self.apply_settings()
return jsonify({"status": True})
return jsonify({
"status": True,
"personalities":self.config["personalities"],
"active_personality_id":self.config["active_personality_id"]
})
else:
return jsonify({"status": False, "error":"Invalid ID"})

View File

@ -0,0 +1,6 @@
POST http://localhost:9600/select_personality
Content-Type: application/json
{
"id": 0
}