fixed translation

This commit is contained in:
Saifeddine ALOUI 2024-05-02 18:25:15 +02:00
parent 7c74f6a6c8
commit 21384fc34b

View File

@ -590,8 +590,8 @@ class LollmsApplication(LoLLMsCom):
if not language_path.exists():
self.ShowBlockingMessage(f"This is the first time this personality speaks {language}\nLollms is reconditionning the persona in that language.\nThis will be done just once. Next time, the personality will speak {language} out of the box")
language_path.parent.mkdir(exist_ok=True, parents=True)
conditionning = "!@>system: "+self.personality.fast_gen(f"!@>instruction: Translate the following text to {language}:\n{self.personality.personality_conditioning.replace('!@>system:','')}\n!@>translation:\n")
welcome_message = self.personality.fast_gen(f"!@>instruction: Translate the following text to {language}:\n{self.personality.welcome_message}\n!@>translation:\n")
conditionning = "!@>system: "+self.personality.fast_gen(f"!@>instruction: Translate the following text to {language}:\n{self.personality.personality_conditioning.replace('!@>system:','')}\n!@>translation:\n", callback=self.personality.sink)
welcome_message = self.personality.fast_gen(f"!@>instruction: Translate the following text to {language}:\n{self.personality.welcome_message}\n!@>translation:\n", callback=self.personality.sink)
with open(language_path,"w",encoding="utf-8", errors="ignore") as f:
yaml.safe_dump({"conditionning":conditionning,"welcome_message":welcome_message}, f)
self.HideBlockingMessage()
@ -659,10 +659,10 @@ class LollmsApplication(LoLLMsCom):
if self.config.current_language and current_language!= default_language:
language_path = self.lollms_paths.personal_configuration_path/"personalities"/self.personality.name/f"languages_{current_language}.yaml"
if not language_path.exists():
self.info(f"This is the first time this personality pseaks {current_language}\nLollms is reconditionning the persona in that language.\nThis will be done just once. Next time, the personality will speak {current_language} out of the box")
self.info(f"This is the first time this personality speaks {current_language}\nLollms is reconditionning the persona in that language.\nThis will be done just once. Next time, the personality will speak {current_language} out of the box")
language_path.parent.mkdir(exist_ok=True, parents=True)
conditionning = "!@>system: "+self.personality.fast_gen(f"!@>instruction: Translate the following text to {current_language}:\n{self.personality.personality_conditioning.replace('!@>system:','')}\n!@>translation:\n")
welcome_message = self.personality.fast_gen(f"!@>instruction: Translate the following text to {current_language}:\n{self.personality.welcome_message}\n!@>translation:\n")
conditionning = "!@>system: "+self.personality.fast_gen(f"!@>instruction: Translate the following text to {current_language}:\n{self.personality.personality_conditioning.replace('!@>system:','')}\n!@>translation:\n", callback=self.personality.sink)
welcome_message = self.personality.fast_gen(f"!@>instruction: Translate the following text to {current_language}:\n{self.personality.welcome_message}\n!@>translation:\n", callback=self.personality.sink)
with open(language_path,"w",encoding="utf-8", errors="ignore") as f:
yaml.safe_dump({"conditionning":conditionning,"welcome_message":welcome_message}, f)
else: