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
261a448c
Unverified
Commit
261a448c
authored
Dec 20, 2022
by
Patrick von Platen
Committed by
GitHub
Dec 20, 2022
Browse files
Correct hf hub download (#1767)
* allow model download when no internet * up * make style
parent
f106ab40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/diffusers/modeling_utils.py
src/diffusers/modeling_utils.py
+2
-1
src/diffusers/pipeline_utils.py
src/diffusers/pipeline_utils.py
+2
-2
No files found.
src/diffusers/modeling_utils.py
View file @
261a448c
...
...
@@ -26,6 +26,7 @@ from huggingface_hub.utils import EntryNotFoundError, RepositoryNotFoundError, R
from
requests
import
HTTPError
from
.
import
__version__
from
.hub_utils
import
HF_HUB_OFFLINE
from
.utils
import
(
CONFIG_NAME
,
DIFFUSERS_CACHE
,
...
...
@@ -376,7 +377,7 @@ class ModelMixin(torch.nn.Module):
resume_download
=
kwargs
.
pop
(
"resume_download"
,
False
)
proxies
=
kwargs
.
pop
(
"proxies"
,
None
)
output_loading_info
=
kwargs
.
pop
(
"output_loading_info"
,
False
)
local_files_only
=
kwargs
.
pop
(
"local_files_only"
,
False
)
local_files_only
=
kwargs
.
pop
(
"local_files_only"
,
HF_HUB_OFFLINE
)
use_auth_token
=
kwargs
.
pop
(
"use_auth_token"
,
None
)
revision
=
kwargs
.
pop
(
"revision"
,
None
)
torch_dtype
=
kwargs
.
pop
(
"torch_dtype"
,
None
)
...
...
src/diffusers/pipeline_utils.py
View file @
261a448c
...
...
@@ -33,7 +33,7 @@ from tqdm.auto import tqdm
from
.configuration_utils
import
ConfigMixin
from
.dynamic_modules_utils
import
get_class_from_dynamic_module
from
.hub_utils
import
http_user_agent
from
.hub_utils
import
HF_HUB_OFFLINE
,
http_user_agent
from
.modeling_utils
import
_LOW_CPU_MEM_USAGE_DEFAULT
from
.schedulers.scheduling_utils
import
SCHEDULER_CONFIG_NAME
from
.utils
import
(
...
...
@@ -441,7 +441,7 @@ class DiffusionPipeline(ConfigMixin):
resume_download
=
kwargs
.
pop
(
"resume_download"
,
False
)
force_download
=
kwargs
.
pop
(
"force_download"
,
False
)
proxies
=
kwargs
.
pop
(
"proxies"
,
None
)
local_files_only
=
kwargs
.
pop
(
"local_files_only"
,
False
)
local_files_only
=
kwargs
.
pop
(
"local_files_only"
,
HF_HUB_OFFLINE
)
use_auth_token
=
kwargs
.
pop
(
"use_auth_token"
,
None
)
revision
=
kwargs
.
pop
(
"revision"
,
None
)
torch_dtype
=
kwargs
.
pop
(
"torch_dtype"
,
None
)
...
...
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