Skip to content

Commit fad5fdb

Browse files
committed
fix: handle additional from_pretrained files in subfolders
1 parent 655edba commit fad5fdb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

llama_cpp/llama.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,14 +2396,15 @@ def from_pretrained(
23962396
)
23972397

23982398
(matching_additional_file,) = matching_additional_files
2399-
subfolder = str(Path(matching_additional_file).parent)
2399+
additional_subfolder = str(Path(matching_additional_file).parent)
24002400
additional_file_name = Path(matching_additional_file).name
24012401

2402-
# download the additional file
2402+
# Split additional file paths independently to avoid duplicating
2403+
# the main model subfolder in Hugging Face download URLs.
24032404
hf_hub_download(
24042405
repo_id=repo_id,
24052406
filename=additional_file_name,
2406-
subfolder=subfolder,
2407+
subfolder=additional_subfolder,
24072408
local_dir=local_dir,
24082409
local_dir_use_symlinks=local_dir_use_symlinks,
24092410
cache_dir=cache_dir,

0 commit comments

Comments
 (0)