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
renzhc
diffusers_dcu
Commits
49979753
Unverified
Commit
49979753
authored
Jul 01, 2024
by
Lucain
Committed by
GitHub
Jul 01, 2024
Browse files
Always raise from previous error (#8751)
parent
a3904d7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/diffusers/utils/hub_utils.py
src/diffusers/utils/hub_utils.py
+13
-13
No files found.
src/diffusers/utils/hub_utils.py
View file @
49979753
...
@@ -358,42 +358,42 @@ def _get_model_file(
...
@@ -358,42 +358,42 @@ def _get_model_file(
)
)
return
model_file
return
model_file
except
RepositoryNotFoundError
:
except
RepositoryNotFoundError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"
{
pretrained_model_name_or_path
}
is not a local folder and is not a valid model identifier "
f
"
{
pretrained_model_name_or_path
}
is not a local folder and is not a valid model identifier "
"listed on 'https://huggingface.co/models'
\n
If this is a private repository, make sure to pass a "
"listed on 'https://huggingface.co/models'
\n
If this is a private repository, make sure to pass a "
"token having permission to this repo with `token` or log in with `huggingface-cli "
"token having permission to this repo with `token` or log in with `huggingface-cli "
"login`."
"login`."
)
)
from
e
except
RevisionNotFoundError
:
except
RevisionNotFoundError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"
{
revision
}
is not a valid git identifier (branch name, tag name or commit id) that exists for "
f
"
{
revision
}
is not a valid git identifier (branch name, tag name or commit id) that exists for "
"this model name. Check the model page at "
"this model name. Check the model page at "
f
"'https://huggingface.co/
{
pretrained_model_name_or_path
}
' for available revisions."
f
"'https://huggingface.co/
{
pretrained_model_name_or_path
}
' for available revisions."
)
)
from
e
except
EntryNotFoundError
:
except
EntryNotFoundError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"
{
pretrained_model_name_or_path
}
does not appear to have a file named
{
weights_name
}
."
f
"
{
pretrained_model_name_or_path
}
does not appear to have a file named
{
weights_name
}
."
)
)
from
e
except
HTTPError
as
e
rr
:
except
HTTPError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"There was a specific connection error when trying to load
{
pretrained_model_name_or_path
}
:
\n
{
e
rr
}
"
f
"There was a specific connection error when trying to load
{
pretrained_model_name_or_path
}
:
\n
{
e
}
"
)
)
from
e
except
ValueError
:
except
ValueError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it"
f
"We couldn't connect to '
{
HUGGINGFACE_CO_RESOLVE_ENDPOINT
}
' to load this model, couldn't find it"
f
" in the cached files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a"
f
" in the cached files and it looks like
{
pretrained_model_name_or_path
}
is not the path to a"
f
" directory containing a file named
{
weights_name
}
or"
f
" directory containing a file named
{
weights_name
}
or"
"
\n
Checkout your internet connection or see how to run the library in"
"
\n
Checkout your internet connection or see how to run the library in"
" offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'."
" offline mode at 'https://huggingface.co/docs/diffusers/installation#offline-mode'."
)
)
from
e
except
EnvironmentError
:
except
EnvironmentError
as
e
:
raise
EnvironmentError
(
raise
EnvironmentError
(
f
"Can't load the model for '
{
pretrained_model_name_or_path
}
'. If you were trying to load it from "
f
"Can't load the model for '
{
pretrained_model_name_or_path
}
'. If you were trying to load it from "
"'https://huggingface.co/models', make sure you don't have a local directory with the same name. "
"'https://huggingface.co/models', make sure you don't have a local directory with the same name. "
f
"Otherwise, make sure '
{
pretrained_model_name_or_path
}
' is the correct path to a directory "
f
"Otherwise, make sure '
{
pretrained_model_name_or_path
}
' is the correct path to a directory "
f
"containing a file named
{
weights_name
}
"
f
"containing a file named
{
weights_name
}
"
)
)
from
e
# Adapted from
# Adapted from
...
...
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