Deprecate TF weight conversion since we have full Safetensors support now (#30786)

This commit is contained in:
Matt 2024-05-14 13:48:17 +01:00 committed by GitHub
parent d8f8a9cd61
commit 9ef3884046
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,6 +267,13 @@ class PTtoTFCommand(BaseTransformersCLICommand):
return pt_input, tf_input
def run(self):
self._logger.warning(
"\n\nConverting 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.
if version.parse(huggingface_hub.__version__) < version.parse("0.9.0"):
raise ImportError(