From b8071cb745e2cdf21a6b20f2e4968b2cb01eb883 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 28 Aug 2023 22:08:52 +0200 Subject: [PATCH] Huge jump --- lollms/app.py | 4 ++-- lollms/apps/server/__init__.py | 3 ++- lollms/personality.py | 10 ++++++++-- setup.py | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lollms/app.py b/lollms/app.py index 7591c11..3d2b26d 100644 --- a/lollms/app.py +++ b/lollms/app.py @@ -124,7 +124,7 @@ class LollmsApplication: def mount_personality(self, id:int, callback=None): 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: self.cond_tk = personality.model.tokenize(personality.personality_conditioning) self.n_cond_tk = len(self.cond_tk) @@ -194,7 +194,7 @@ class LollmsApplication: def load_personality(self, callback=None): 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: 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}") diff --git a/lollms/apps/server/__init__.py b/lollms/apps/server/__init__.py index 8299041..ee3554a 100644 --- a/lollms/apps/server/__init__.py +++ b/lollms/apps/server/__init__.py @@ -402,7 +402,8 @@ class LoLLMsServer(LollmsApplication): personality_path, self.lollms_paths, self.config, - self.model + self.model, + self ) self.personalities.append(personality) self.config["personalities"].append(personality_path) diff --git a/lollms/personality.py b/lollms/personality.py index 86ab224..ee9ce2f 100644 --- a/lollms/personality.py +++ b/lollms/personality.py @@ -51,7 +51,8 @@ class AIPersonality: personality_package_path: str|Path, lollms_paths:LollmsPaths, config:LOLLMSConfig, - model:LLMBinding=None, + model:LLMBinding=None, + app=None, run_scripts=True, selected_language=None, is_relative_path=True, @@ -71,6 +72,7 @@ class AIPersonality: self.model = model self.config = config self.callback = callback + self.app = app self.files = [] self.vectorizer = None @@ -1415,12 +1417,14 @@ class PersonalityBuilder: lollms_paths:LollmsPaths, config:LOLLMSConfig, model:LLMBinding, + app=None, installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY, callback=None ): self.config = config self.lollms_paths = lollms_paths self.model = model + self.app = app self.installation_option = installation_option self.callback = callback @@ -1449,7 +1453,8 @@ class PersonalityBuilder: personality_folder, self.lollms_paths, self.config, - self.model, + self.model, + app=self.app, selected_language=personality_language, installation_option=self.installation_option, callback=self.callback @@ -1460,6 +1465,7 @@ class PersonalityBuilder: self.lollms_paths, self.config, self.model, + app=self.app, is_relative_path=False, selected_language=personality_language, installation_option=self.installation_option, diff --git a/setup.py b/setup.py index 24d5b0b..ff70fd4 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_all_files(path): setuptools.setup( name="lollms", - version="4.5.3", + version="5.0.0", author="Saifeddine ALOUI", author_email="aloui.saifeddine@gmail.com", description="A python library for AI personality definition",