mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-24 14:56:44 +00:00
updated
This commit is contained in:
parent
84bed4806e
commit
fb5b467966
@ -28,21 +28,22 @@ __license__ = "Apache 2.0"
|
|||||||
|
|
||||||
class LLMBinding:
|
class LLMBinding:
|
||||||
|
|
||||||
file_extension='*.bin'
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
binding_dir:Path,
|
binding_dir:Path,
|
||||||
lollms_paths:LollmsPaths,
|
lollms_paths:LollmsPaths,
|
||||||
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'
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
self.binding_dir = binding_dir
|
self.binding_dir = binding_dir
|
||||||
self.binding_folder_name = binding_dir.stem
|
self.binding_folder_name = binding_dir.stem
|
||||||
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.configuration_file_path = lollms_paths.personal_configuration_path/f"binding_{self.binding_folder_name}.yaml"
|
self.configuration_file_path = lollms_paths.personal_configuration_path/f"binding_{self.binding_folder_name}.yaml"
|
||||||
@ -172,6 +173,12 @@ class LLMBinding:
|
|||||||
"""
|
"""
|
||||||
return " ".join(tokens_list)
|
return " ".join(tokens_list)
|
||||||
|
|
||||||
|
def list_models(self, config:dict):
|
||||||
|
"""Lists the models for this binding
|
||||||
|
"""
|
||||||
|
models_dir = self.lollms_paths.bindings_zoo_path/config["binding_name"] # replace with the actual path to the models folder
|
||||||
|
return [f.name for f in models_dir.glob(self.file_extension)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def reinstall_pytorch_with_cuda():
|
def reinstall_pytorch_with_cuda():
|
||||||
result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir", "--index-url", "https://download.pytorch.org/whl/cu117"])
|
result = subprocess.run(["pip", "install", "--upgrade", "torch", "torchvision", "torchaudio", "--no-cache-dir", "--index-url", "https://download.pytorch.org/whl/cu117"])
|
||||||
|
2
setup.py
2
setup.py
@ -26,7 +26,7 @@ def get_all_files(path):
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="lollms",
|
name="lollms",
|
||||||
version="2.0.5",
|
version="2.0.6",
|
||||||
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