From fc602d17c4ccd25229e4a8590015670a2eee411f Mon Sep 17 00:00:00 2001 From: jameschung2000 Date: Wed, 9 Aug 2023 01:44:55 +0800 Subject: [PATCH] Fix loading GPTQ model from a local file or directory (#80) Co-authored-by: James Zhong --- ctransformers/gptq/hub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ctransformers/gptq/hub.py b/ctransformers/gptq/hub.py index a19d1af..4324e07 100644 --- a/ctransformers/gptq/hub.py +++ b/ctransformers/gptq/hub.py @@ -55,7 +55,9 @@ def from_pretrained( model_path = None if path_type == "file": - model_path = Path(model_path).parent + model_path = Path(model_path_or_repo_id).parent + elif path_type == "dir" : + model_path = Path(model_path_or_repo_id) elif path_type == "repo": model_path = snapshot_download( repo_id=model_path_or_repo_id,