Huge jump

This commit is contained in:
Saifeddine ALOUI 2023-08-28 22:08:52 +02:00
parent fe893305c7
commit b8071cb745
4 changed files with 13 additions and 6 deletions

View File

@ -124,7 +124,7 @@ class LollmsApplication:
def mount_personality(self, id:int, callback=None): def mount_personality(self, id:int, callback=None):
try: try:
personality = PersonalityBuilder(self.lollms_paths, self.config, self.model, callback=callback).build_personality(id) personality = PersonalityBuilder(self.lollms_paths, self.config, self.model, self, callback=callback).build_personality(id)
if personality.model is not None: if personality.model is not None:
self.cond_tk = personality.model.tokenize(personality.personality_conditioning) self.cond_tk = personality.model.tokenize(personality.personality_conditioning)
self.n_cond_tk = len(self.cond_tk) self.n_cond_tk = len(self.cond_tk)
@ -194,7 +194,7 @@ class LollmsApplication:
def load_personality(self, callback=None): def load_personality(self, callback=None):
try: try:
personality = PersonalityBuilder(self.lollms_paths, self.config, self.model, callback=callback).build_personality() personality = PersonalityBuilder(self.lollms_paths, self.config, self.model, self, callback=callback).build_personality()
except Exception as ex: except Exception as ex:
ASCIIColors.error(f"Couldn't load personality. Please verify your configuration file at {self.configuration_path} or use the next menu to select a valid personality") ASCIIColors.error(f"Couldn't load personality. Please verify your configuration file at {self.configuration_path} or use the next menu to select a valid personality")
ASCIIColors.error(f"Binding returned this exception : {ex}") ASCIIColors.error(f"Binding returned this exception : {ex}")

View File

@ -402,7 +402,8 @@ class LoLLMsServer(LollmsApplication):
personality_path, personality_path,
self.lollms_paths, self.lollms_paths,
self.config, self.config,
self.model self.model,
self
) )
self.personalities.append(personality) self.personalities.append(personality)
self.config["personalities"].append(personality_path) self.config["personalities"].append(personality_path)

View File

@ -52,6 +52,7 @@ class AIPersonality:
lollms_paths:LollmsPaths, lollms_paths:LollmsPaths,
config:LOLLMSConfig, config:LOLLMSConfig,
model:LLMBinding=None, model:LLMBinding=None,
app=None,
run_scripts=True, run_scripts=True,
selected_language=None, selected_language=None,
is_relative_path=True, is_relative_path=True,
@ -71,6 +72,7 @@ class AIPersonality:
self.model = model self.model = model
self.config = config self.config = config
self.callback = callback self.callback = callback
self.app = app
self.files = [] self.files = []
self.vectorizer = None self.vectorizer = None
@ -1415,12 +1417,14 @@ class PersonalityBuilder:
lollms_paths:LollmsPaths, lollms_paths:LollmsPaths,
config:LOLLMSConfig, config:LOLLMSConfig,
model:LLMBinding, model:LLMBinding,
app=None,
installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY, installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY,
callback=None callback=None
): ):
self.config = config self.config = config
self.lollms_paths = lollms_paths self.lollms_paths = lollms_paths
self.model = model self.model = model
self.app = app
self.installation_option = installation_option self.installation_option = installation_option
self.callback = callback self.callback = callback
@ -1450,6 +1454,7 @@ class PersonalityBuilder:
self.lollms_paths, self.lollms_paths,
self.config, self.config,
self.model, self.model,
app=self.app,
selected_language=personality_language, selected_language=personality_language,
installation_option=self.installation_option, installation_option=self.installation_option,
callback=self.callback callback=self.callback
@ -1460,6 +1465,7 @@ class PersonalityBuilder:
self.lollms_paths, self.lollms_paths,
self.config, self.config,
self.model, self.model,
app=self.app,
is_relative_path=False, is_relative_path=False,
selected_language=personality_language, selected_language=personality_language,
installation_option=self.installation_option, installation_option=self.installation_option,

View File

@ -26,7 +26,7 @@ def get_all_files(path):
setuptools.setup( setuptools.setup(
name="lollms", name="lollms",
version="4.5.3", version="5.0.0",
author="Saifeddine ALOUI", author="Saifeddine ALOUI",
author_email="aloui.saifeddine@gmail.com", author_email="aloui.saifeddine@gmail.com",
description="A python library for AI personality definition", description="A python library for AI personality definition",