Skip to content

Commit 94bbf8e

Browse files
authored
Resolve remote custom module path warnings (#41243)
1 parent c4b505d commit 94bbf8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/dynamic_module_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def get_cached_module_file(
395395
if is_local:
396396
submodule = _sanitize_module_name(os.path.basename(pretrained_model_name_or_path))
397397
else:
398-
submodule = _sanitize_module_name(pretrained_model_name_or_path.replace("/", os.path.sep))
398+
submodule = os.path.sep.join(map(_sanitize_module_name, pretrained_model_name_or_path.split("/")))
399399
cached_module = try_to_load_from_cache(
400400
pretrained_model_name_or_path, module_file, cache_dir=cache_dir, revision=_commit_hash, repo_type=repo_type
401401
)

0 commit comments

Comments
 (0)