This commit is contained in:
Saifeddine ALOUI 2023-08-29 02:25:50 +02:00
parent f906c0d98e
commit 9305887970
2 changed files with 17 additions and 1 deletions

View File

@ -858,6 +858,7 @@ class LoLLMsAPPI(LollmsApplication):
self.lollms_paths,
self.config,
model=self.model,
app=self,
selected_language=personality.split(":")[1] if ":" in personality else None,
run_scripts=True)
mounted_personalities.append(personality)
@ -872,6 +873,7 @@ class LoLLMsAPPI(LollmsApplication):
self.lollms_paths,
self.config,
self.model,
app = self,
run_scripts=True,
selected_language=personality.split(":")[1] if ":" in personality else None,
installation_option=InstallOption.FORCE_INSTALL)

14
app.py
View File

@ -222,6 +222,8 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.add_endpoint("/post_to_personality", "post_to_personality", self.post_to_personality, methods=["POST"])
self.add_endpoint("/install_model_from_path", "install_model_from_path", self.install_model_from_path, methods=["GET"])
@ -1169,6 +1171,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.lollms_paths,
self.config,
model=self.model,
app=self,
run_scripts=True,installation_option=InstallOption.FORCE_INSTALL)
return jsonify({"status":True})
except Exception as ex:
@ -1179,6 +1182,14 @@ class LoLLMsWebUI(LoLLMsAPPI):
except Exception as e:
return jsonify({"status":False, 'error':str(e)})
def post_to_personality(self):
data = request.get_json()
if hasattr(self.personality.processor,'handle_request'):
return self.personality.processor.handle_request(data)
else:
return jsonify({})
def reinstall_binding(self):
try:
data = request.get_json()
@ -1396,6 +1407,8 @@ class LoLLMsWebUI(LoLLMsAPPI):
ASCIIColors.error(f"nok : Personality not found @ {pth}")
return jsonify({"status": False, "error":f"Personality not found @ {pth}"})
def p_remount_personality(self):
print("- Remounting personality")
try:
@ -1587,6 +1600,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.lollms_paths,
self.config,
model=self.model,
app=self,
run_scripts=True)
if personality.processor is not None:
if hasattr(personality.processor,"personality_config"):