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
9ef38840
Unverified
Commit
9ef38840
authored
May 14, 2024
by
Matt
Committed by
GitHub
May 14, 2024
Browse files
Deprecate TF weight conversion since we have full Safetensors support now (#30786)
parent
d8f8a9cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/transformers/commands/pt_to_tf.py
src/transformers/commands/pt_to_tf.py
+7
-0
No files found.
src/transformers/commands/pt_to_tf.py
View file @
9ef38840
...
@@ -267,6 +267,13 @@ class PTtoTFCommand(BaseTransformersCLICommand):
...
@@ -267,6 +267,13 @@ class PTtoTFCommand(BaseTransformersCLICommand):
return
pt_input
,
tf_input
return
pt_input
,
tf_input
def
run
(
self
):
def
run
(
self
):
self
.
_logger
.
warning
(
"
\n\n
Converting PyTorch weights to TensorFlow is deprecated and will be removed in v4.43. "
"Instead, we recommend that you convert PyTorch weights to Safetensors, an improved "
"format that can be loaded by any framework, including TensorFlow. For more information, "
"please see the Safetensors conversion guide: "
"https://huggingface.co/docs/safetensors/en/convert-weights
\n\n
"
)
# hub version 0.9.0 introduced the possibility of programmatically opening PRs with normal write tokens.
# hub version 0.9.0 introduced the possibility of programmatically opening PRs with normal write tokens.
if
version
.
parse
(
huggingface_hub
.
__version__
)
<
version
.
parse
(
"0.9.0"
):
if
version
.
parse
(
huggingface_hub
.
__version__
)
<
version
.
parse
(
"0.9.0"
):
raise
ImportError
(
raise
ImportError
(
...
...
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