From 1364c7495482275ba3a5b5908643eae1f3927a04 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 25 Aug 2023 21:47:36 +0200 Subject: [PATCH] Added gguf support --- docs/LLMBinding_doc.md | 2 +- lollms/binding.py | 6 +++--- lollms/personality.py | 3 --- lollms/utilities.py | 2 +- setup.py | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/LLMBinding_doc.md b/docs/LLMBinding_doc.md index 5987dd7..47f75b5 100644 --- a/docs/LLMBinding_doc.md +++ b/docs/LLMBinding_doc.md @@ -11,7 +11,7 @@ Here's a breakdown of the important components and methods in the LLMBinding cla - `config` (LOLLMSConfig): The global configuration object for LOLLMS. - `binding_config` (TypedConfig): The configuration object specific to the binding. - `installation_option` (InstallOption, optional): The installation option for the binding. Defaults to `InstallOption.INSTALL_IF_NECESSARY`. - - `file_extension` (str, optional): The file extension for models supported by the binding. Defaults to `"*.bin"`. + - `supported_file_extensions` (str, optional): The file extension for models supported by the binding. Defaults to `"*.bin"`. - Description: The constructor initializes the LLMBinding object and sets up various properties based on the provided parameters. It also handles the installation of the binding if necessary. 2. **Installation Methods:** diff --git a/lollms/binding.py b/lollms/binding.py index 270d69e..6c45368 100644 --- a/lollms/binding.py +++ b/lollms/binding.py @@ -40,7 +40,7 @@ class LLMBinding: config:LOLLMSConfig, binding_config:TypedConfig, installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY, - file_extension='*.bin' + supported_file_extensions='*.bin' ) -> None: self.binding_dir = binding_dir @@ -48,7 +48,7 @@ class LLMBinding: self.lollms_paths = lollms_paths self.config = config self.binding_config = binding_config - self.file_extension = file_extension + self.supported_file_extensions = supported_file_extensions self.seed = config["seed"] self.configuration_file_path = lollms_paths.personal_configuration_path/"bindings"/self.binding_folder_name/f"config.yaml" @@ -254,7 +254,7 @@ class LLMBinding: """Lists the models for this binding """ models_dir = self.lollms_paths.personal_models_path/config["binding_name"] # replace with the actual path to the models folder - return [f.name for f in models_dir.iterdir() if f.suffix == self.file_extension.replace("*","") or f.suffix==".reference"] + return [f.name for f in models_dir.iterdir() if f.suffix in self.supported_file_extensions or f.suffix==".reference"] @staticmethod def reinstall_pytorch_with_cuda(): diff --git a/lollms/personality.py b/lollms/personality.py index 88405d3..eade178 100644 --- a/lollms/personality.py +++ b/lollms/personality.py @@ -1006,9 +1006,6 @@ class APScript(StateMachine): else: self.load_personality_config() - self.models_folder = self.personality.lollms_paths.personal_models_path / self.personality.personality_folder_name - self.models_folder.mkdir(parents=True, exist_ok=True) - def load_personality_config(self): """ diff --git a/lollms/utilities.py b/lollms/utilities.py index fd788f9..38404d3 100644 --- a/lollms/utilities.py +++ b/lollms/utilities.py @@ -112,7 +112,7 @@ class File64BitsManager: return Image.open(io.BytesIO(base64.b64decode(image_data))) @staticmethod - def get_file_extension_from_base64(b64data): + def get_supported_file_extensions_from_base64(b64data): # Extract the file extension from the base64 data data_match = re.match(r'^data:(.*?);base64,', b64data) if data_match: diff --git a/setup.py b/setup.py index d5e662b..ee80aed 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_all_files(path): setuptools.setup( name="lollms", - version="4.1.5", + version="4.2.0", author="Saifeddine ALOUI", author_email="aloui.saifeddine@gmail.com", description="A python library for AI personality definition",