Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix]enable fix-lock in configuration downloading #4274

Merged
merged 1 commit into from
Dec 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions paddlenlp/transformers/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from ..utils import CONFIG_NAME
from ..utils.downloader import (
COMMUNITY_MODEL_PREFIX,
get_path_from_url,
get_path_from_url_with_filelock,
is_url,
url_file_exists,
)
Expand Down Expand Up @@ -148,7 +148,7 @@ def cached_path(
shutil.rmtree(file_path, ignore_errors=True)

# URL, so get it from the cache (downloading if necessary)
output_path = get_path_from_url(
output_path = get_path_from_url_with_filelock(
url_or_filename,
root_dir=cache_dir,
)
Expand Down Expand Up @@ -784,7 +784,7 @@ def _get_config_dict(

# 3. get the configuration file from url, eg: https://ip/path/to/model_config.jsons
elif is_url(pretrained_model_name_or_path):
resolved_config_file = get_path_from_url(
resolved_config_file = get_path_from_url_with_filelock(
pretrained_model_name_or_path, cache_dir, check_exist=not force_download
)
# 4. get the configuration file from local dir with default name, eg: /local/path
Expand Down