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
790a909b
Unverified
Commit
790a909b
authored
Mar 07, 2025
by
Dhruv Nair
Committed by
GitHub
Mar 06, 2025
Browse files
[Single File] Add user agent to SF download requests. (#10979)
update
parent
54ab4753
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/diffusers/loaders/single_file_utils.py
src/diffusers/loaders/single_file_utils.py
+2
-0
No files found.
src/diffusers/loaders/single_file_utils.py
View file @
790a909b
...
@@ -397,6 +397,7 @@ def load_single_file_checkpoint(
...
@@ -397,6 +397,7 @@ def load_single_file_checkpoint(
else
:
else
:
repo_id
,
weights_name
=
_extract_repo_id_and_weights_name
(
pretrained_model_link_or_path
)
repo_id
,
weights_name
=
_extract_repo_id_and_weights_name
(
pretrained_model_link_or_path
)
user_agent
=
{
"file_type"
:
"single_file"
,
"framework"
:
"pytorch"
}
pretrained_model_link_or_path
=
_get_model_file
(
pretrained_model_link_or_path
=
_get_model_file
(
repo_id
,
repo_id
,
weights_name
=
weights_name
,
weights_name
=
weights_name
,
...
@@ -406,6 +407,7 @@ def load_single_file_checkpoint(
...
@@ -406,6 +407,7 @@ def load_single_file_checkpoint(
local_files_only
=
local_files_only
,
local_files_only
=
local_files_only
,
token
=
token
,
token
=
token
,
revision
=
revision
,
revision
=
revision
,
user_agent
=
user_agent
,
)
)
checkpoint
=
load_state_dict
(
pretrained_model_link_or_path
,
disable_mmap
=
disable_mmap
)
checkpoint
=
load_state_dict
(
pretrained_model_link_or_path
,
disable_mmap
=
disable_mmap
)
...
...
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