Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a1afec9e
Unverified
Commit
a1afec9e
authored
Feb 06, 2024
by
Lucain
Committed by
GitHub
Feb 06, 2024
Browse files
Explicit server error on gated model (#28894)
parent
89439fea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/transformers/utils/hub.py
src/transformers/utils/hub.py
+2
-3
No files found.
src/transformers/utils/hub.py
View file @
a1afec9e
...
@@ -414,9 +414,8 @@ def cached_file(
...
@@ -414,9 +414,8 @@ def cached_file(
if
resolved_file
is
not
None
or
not
_raise_exceptions_for_gated_repo
:
if
resolved_file
is
not
None
or
not
_raise_exceptions_for_gated_repo
:
return
resolved_file
return
resolved_file
raise
EnvironmentError
(
raise
EnvironmentError
(
"You are trying to access a gated repo.
\n
Make sure to request access at "
"You are trying to access a gated repo.
\n
Make sure to have access to it at "
f
"https://huggingface.co/
{
path_or_repo_id
}
and pass a token having permission to this repo either "
f
"https://huggingface.co/
{
path_or_repo_id
}
.
\n
{
str
(
e
)
}
"
"by logging in with `huggingface-cli login` or by passing `token=<your_token>`."
)
from
e
)
from
e
except
RepositoryNotFoundError
as
e
:
except
RepositoryNotFoundError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment