mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
Added gguf support
This commit is contained in:
parent
4908ed7e6d
commit
1364c74954
@ -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.
|
- `config` (LOLLMSConfig): The global configuration object for LOLLMS.
|
||||||
- `binding_config` (TypedConfig): The configuration object specific to the binding.
|
- `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`.
|
- `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.
|
- 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:**
|
2. **Installation Methods:**
|
||||||
|
@ -40,7 +40,7 @@ class LLMBinding:
|
|||||||
config:LOLLMSConfig,
|
config:LOLLMSConfig,
|
||||||
binding_config:TypedConfig,
|
binding_config:TypedConfig,
|
||||||
installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY,
|
installation_option:InstallOption=InstallOption.INSTALL_IF_NECESSARY,
|
||||||
file_extension='*.bin'
|
supported_file_extensions='*.bin'
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
self.binding_dir = binding_dir
|
self.binding_dir = binding_dir
|
||||||
@ -48,7 +48,7 @@ class LLMBinding:
|
|||||||
self.lollms_paths = lollms_paths
|
self.lollms_paths = lollms_paths
|
||||||
self.config = config
|
self.config = config
|
||||||
self.binding_config = binding_config
|
self.binding_config = binding_config
|
||||||
self.file_extension = file_extension
|
self.supported_file_extensions = supported_file_extensions
|
||||||
self.seed = config["seed"]
|
self.seed = config["seed"]
|
||||||
|
|
||||||
self.configuration_file_path = lollms_paths.personal_configuration_path/"bindings"/self.binding_folder_name/f"config.yaml"
|
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
|
"""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
|
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
|
@staticmethod
|
||||||
def reinstall_pytorch_with_cuda():
|
def reinstall_pytorch_with_cuda():
|
||||||
|
@ -1006,9 +1006,6 @@ class APScript(StateMachine):
|
|||||||
else:
|
else:
|
||||||
self.load_personality_config()
|
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):
|
def load_personality_config(self):
|
||||||
"""
|
"""
|
||||||
|
@ -112,7 +112,7 @@ class File64BitsManager:
|
|||||||
return Image.open(io.BytesIO(base64.b64decode(image_data)))
|
return Image.open(io.BytesIO(base64.b64decode(image_data)))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_file_extension_from_base64(b64data):
|
def get_supported_file_extensions_from_base64(b64data):
|
||||||
# Extract the file extension from the base64 data
|
# Extract the file extension from the base64 data
|
||||||
data_match = re.match(r'^data:(.*?);base64,', b64data)
|
data_match = re.match(r'^data:(.*?);base64,', b64data)
|
||||||
if data_match:
|
if data_match:
|
||||||
|
2
setup.py
2
setup.py
@ -26,7 +26,7 @@ def get_all_files(path):
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="lollms",
|
name="lollms",
|
||||||
version="4.1.5",
|
version="4.2.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",
|
||||||
|
Loading…
Reference in New Issue
Block a user