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
6487e9b3
Unverified
Commit
6487e9b3
authored
Apr 09, 2024
by
Yih-Dar
Committed by
GitHub
Apr 09, 2024
Browse files
Send headers when converting safetensors (#30144)
Co-authored-by:
Wauplin
<
lucainp@gmail.com
>
parent
08a194fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/safetensors_conversion.py
src/transformers/safetensors_conversion.py
+2
-2
No files found.
src/transformers/safetensors_conversion.py
View file @
6487e9b3
...
...
@@ -5,7 +5,7 @@ from typing import Optional
import
requests
from
huggingface_hub
import
Discussion
,
HfApi
,
get_repo_discussions
from
.utils
import
cached_file
,
logging
from
.utils
import
cached_file
,
http_user_agent
,
logging
logger
=
logging
.
get_logger
(
__name__
)
...
...
@@ -86,7 +86,7 @@ def get_conversion_pr_reference(api: HfApi, model_id: str, **kwargs):
def
auto_conversion
(
pretrained_model_name_or_path
:
str
,
ignore_errors_during_conversion
=
False
,
**
cached_file_kwargs
):
try
:
api
=
HfApi
(
token
=
cached_file_kwargs
.
get
(
"token"
))
api
=
HfApi
(
token
=
cached_file_kwargs
.
get
(
"token"
)
,
headers
=
http_user_agent
()
)
sha
=
get_conversion_pr_reference
(
api
,
pretrained_model_name_or_path
,
**
cached_file_kwargs
)
if
sha
is
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