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