File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2255,7 +2255,7 @@ def from_pretrained(
2255
2255
Returns:
2256
2256
A Llama model."""
2257
2257
try :
2258
- from huggingface_hub import hf_hub_download , HfFileSystem
2258
+ from huggingface_hub import hf_hub_download , snapshot_download , HfFileSystem
2259
2259
from huggingface_hub .utils import validate_repo_id
2260
2260
except ImportError :
2261
2261
raise ImportError (
@@ -2320,10 +2320,14 @@ def from_pretrained(
2320
2320
)
2321
2321
2322
2322
if len (matching_additional_files ) > 1 :
2323
- raise ValueError (
2324
- f"Multiple files found in { repo_id } matching { additonal_file_name } \n \n "
2325
- f"Available Files:\n { json .dumps (files )} "
2323
+ snapshot_download (
2324
+ repo_id = repo_id ,
2325
+ allow_patterns = additonal_file_name ,
2326
+ local_dir = local_dir ,
2327
+ local_dir_use_symlinks = local_dir_use_symlinks ,
2328
+ cache_dir = cache_dir ,
2326
2329
)
2330
+ continue
2327
2331
2328
2332
(matching_additional_file ,) = matching_additional_files
2329
2333
You can’t perform that action at this time.
0 commit comments