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

Allow user to see actual error if a download has failed #5925

Closed
wants to merge 1 commit into from

Conversation

festeh
Copy link

@festeh festeh commented Jul 20, 2020

Fixes #5869. Adds new logic of exception handling.

  • If there was a caught exception in cached_path during download, and force_download is True, then raise it
  • If force_download is False, save this exception and raise it later, it file is not in local cache
  • If download exception in cached_path was raised, then re-raise it in calling function. If there's no exception, but resolved file is None, keep old message ("...is a correct model identifier...")

It would be great to know if there's a better way to dealing with this issue.

@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #5925 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5925      +/-   ##
==========================================
- Coverage   78.51%   78.51%   -0.01%     
==========================================
  Files         146      146              
  Lines       26214    26214              
==========================================
- Hits        20583    20582       -1     
- Misses       5631     5632       +1     
Impacted Files Coverage Δ
src/transformers/configuration_utils.py 96.52% <ø> (ø)
src/transformers/file_utils.py 81.19% <ø> (-0.30%) ⬇️
src/transformers/modeling_tf_utils.py 88.88% <ø> (ø)
src/transformers/modeling_utils.py 87.14% <ø> (ø)
src/transformers/generation_tf_utils.py 86.46% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32883b3...80220ae. Read the comment docs.

@LysandreJik LysandreJik self-assigned this Jul 28, 2020
@stale
Copy link

stale bot commented Sep 26, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 26, 2020
@stale stale bot closed this Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Silenced error while downloading pretrained model
2 participants