Skip to content

Commit def43c5

Browse files
authored
enable fix-lock in configuration (#4274)
1 parent 81b78e6 commit def43c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paddlenlp/transformers/configuration_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from ..utils import CONFIG_NAME
3939
from ..utils.downloader import (
4040
COMMUNITY_MODEL_PREFIX,
41-
get_path_from_url,
41+
get_path_from_url_with_filelock,
4242
is_url,
4343
url_file_exists,
4444
)
@@ -148,7 +148,7 @@ def cached_path(
148148
shutil.rmtree(file_path, ignore_errors=True)
149149

150150
# URL, so get it from the cache (downloading if necessary)
151-
output_path = get_path_from_url(
151+
output_path = get_path_from_url_with_filelock(
152152
url_or_filename,
153153
root_dir=cache_dir,
154154
)
@@ -788,7 +788,7 @@ def _get_config_dict(
788788

789789
# 3. get the configuration file from url, eg: https://ip/path/to/model_config.jsons
790790
elif is_url(pretrained_model_name_or_path):
791-
resolved_config_file = get_path_from_url(
791+
resolved_config_file = get_path_from_url_with_filelock(
792792
pretrained_model_name_or_path, cache_dir, check_exist=not force_download
793793
)
794794
# 4. get the configuration file from local dir with default name, eg: /local/path

0 commit comments

Comments
 (0)