mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-24 06:46:40 +00:00
fixed models loading
This commit is contained in:
parent
339160812a
commit
d6aa7a11bd
@ -223,7 +223,16 @@ 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():
|
||||||
model_path = mn/model_name
|
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
|
||||||
break
|
break
|
||||||
if model_path is None:
|
if model_path is None:
|
||||||
model_path = self.models_folders[0]/model_name
|
model_path = self.models_folders[0]/model_name
|
||||||
@ -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"]
|
||||||
|
2
setup.py
2
setup.py
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user