added personality language selection

This commit is contained in:
Saifeddine ALOUI 2024-05-02 01:21:39 +02:00
parent ed4da43b8b
commit 0582fb3d01
5 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
version: 87
version: 88
binding_name: null
model_name: null
model_variant: null
@ -178,7 +178,7 @@ pdf_latex_path: null
# boosting information
positive_boost: null
negative_boost: null
current_language: null
current_language: english
fun_mode: false

View File

@ -562,9 +562,7 @@ class LollmsApplication(LoLLMsCom):
languages_dir = self.lollms_paths.personal_configuration_path / "personalities" / self.personality.name
default_language = self.personality.language.lower().strip().split()[0]
# Vérifier si le dossier existe
if not languages_dir.exists():
print(f"Le dossier {languages_dir} n'existe pas.")
return languages
languages_dir.mkdir(parents=True, exist_ok=True)
# Itérer sur chaque fichier YAML dans le dossier
for language_file in languages_dir.glob("languages_*.yaml"):

View File

@ -1,5 +1,5 @@
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
version: 87
version: 88
binding_name: null
model_name: null
model_variant: null
@ -178,7 +178,7 @@ pdf_latex_path: null
# boosting information
positive_boost: null
negative_boost: null
current_language: null
current_language: english
fun_mode: false

View File

@ -1,5 +1,5 @@
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
version: 87
version: 88
binding_name: null
model_name: null
model_variant: null
@ -178,7 +178,7 @@ pdf_latex_path: null
# boosting information
positive_boost: null
negative_boost: null
current_language: null
current_language: english
fun_mode: false

View File

@ -567,7 +567,15 @@ def select_personality(data:PersonalitySelectionInfos):
if lollmsElfServer.personality.processor:
lollmsElfServer.personality.processor.selected()
ASCIIColors.success("ok")
print(f"Selected {lollmsElfServer.personality.name}")
language = lollmsElfServer.config.current_language
default_language = lollmsElfServer.personality.language.lower().strip().split()[0]
if language != default_language:
lollmsElfServer.set_personality_language(language)
if lollmsElfServer.config.auto_save:
ASCIIColors.info("Saving configuration")
lollmsElfServer.config.save_config()