fixed models loading

This commit is contained in:
Saifeddine ALOUI 2023-10-19 03:03:17 +02:00
parent 339160812a
commit d6aa7a11bd
2 changed files with 12 additions and 3 deletions

View File

@ -223,6 +223,15 @@ class LLMBinding:
model_path=None model_path=None
for mn in self.models_folders: for mn in self.models_folders:
if mn.name in model_name.lower(): if mn.name in model_name.lower():
if mn.name == "ggml":
idx = model_name.index("-GGML")
models=[m for m in mn.iterdir() if model_name[:idx] in m.name]
model_path = mn/models[0].name
elif mn.name == "gguf":
idx = model_name.index("-GGUF")
models=[m for m in mn.iterdir() if model_name[:idx] in m.name]
model_path = mn/models[0].name
else:
model_path = mn/model_name model_path = mn/model_name
break break
if model_path is None: if model_path is None:
@ -352,7 +361,7 @@ class LLMBinding:
""" """
models = [] models = []
for models_folder in self.models_folders: for models_folder in self.models_folders:
if models_folder in ["ggml","gguf"]: if models_folder.name in ["ggml","gguf"]:
models+=[f.name for f in models_folder.iterdir() if f.suffix in self.supported_file_extensions or f.suffix==".reference"] models+=[f.name for f in models_folder.iterdir() if f.suffix in self.supported_file_extensions or f.suffix==".reference"]
else: else:
models+=[f.name for f in models_folder.iterdir() if f.is_dir() and not f.stem.startswith(".") or f.suffix==".reference"] models+=[f.name for f in models_folder.iterdir() if f.is_dir() and not f.stem.startswith(".") or f.suffix==".reference"]

View File

@ -26,7 +26,7 @@ def get_all_files(path):
setuptools.setup( setuptools.setup(
name="lollms", name="lollms",
version="5.8.3", version="5.8.5",
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",