fixed exllamav2 and hugging face bindings

This commit is contained in:
Saifeddine ALOUI 2024-02-29 22:10:14 +01:00
parent 712b176bc3
commit 8b7edf241c

View File

@ -130,6 +130,8 @@ class LLMBinding:
break
if not mp:
return None
if model_path.name in ["ggml","gguf"]:
# model_path/str(model_name).split("/")[-1]
if mp.is_dir():
for f in mp.iterdir():
@ -148,7 +150,8 @@ class LLMBinding:
root_path = model_root
self.config.save_config()
return model_path
else:
return mp
def download_model(self, url, model_name, callback = None):
folder_path = self.searchModelFolder(model_name)
@ -634,16 +637,7 @@ class LLMBinding:
if self.config.model_name is None:
return None
if self.config.model_name.endswith(".reference"):
ASCIIColors.yellow("Loading a reference model:")
ref_path = self.searchModelPath(self.config.model_name)
if ref_path.exists():
with open(str(ref_path), 'r') as f:
model_path = Path(f.read())
ASCIIColors.yellow(model_path)
else:
return None
else:
model_path = self.searchModelPath(self.config.model_name)
return model_path