Skip to content

Commit 066638c

Browse files
committed
fix hf from_pretrained sharded files
1 parent 4dbb8f9 commit 066638c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llama_cpp/llama.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,11 +2308,14 @@ def from_pretrained(
23082308

23092309
(matching_additional_file,) = matching_additional_files
23102310

2311+
matching_additional_subfolder = str(Path(matching_additional_file).parent)
2312+
matching_additional_filename = Path(matching_additional_file).name
2313+
23112314
# download the additional file
23122315
hf_hub_download(
23132316
repo_id=repo_id,
2314-
filename=matching_additional_file,
2315-
subfolder=subfolder,
2317+
filename=matching_additional_filename,
2318+
subfolder=matching_additional_subfolder,
23162319
local_dir=local_dir,
23172320
local_dir_use_symlinks=local_dir_use_symlinks,
23182321
cache_dir=cache_dir,

0 commit comments

Comments
 (0)