-
Notifications
You must be signed in to change notification settings - Fork 31k
🚨🚨🚨 Fully remove Tensorflow and Jax support library-wide #40760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
475c567 to
9190046
Compare
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
f71cedb to
1ecdc29
Compare
8706485 to
b00b07e
Compare
7120b37 to
4069e64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what a cleanup!
Be careful about the conversion scripts, we keep the ones that go from original -> torch
src/transformers/models/albert/convert_albert_original_tf_checkpoint_to_pytorch.py
Show resolved
Hide resolved
src/transformers/models/bert/convert_bert_original_tf_checkpoint_to_pytorch.py
Show resolved
Hide resolved
| @@ -181,7 +174,7 @@ def _sanitize_parameters( | |||
| preprocess_params["prefix"] = prefix | |||
| if prefix: | |||
| prefix_inputs = self.tokenizer( | |||
| prefix, padding=False, add_special_tokens=add_special_tokens, return_tensors=self.framework | |||
| prefix, padding=False, add_special_tokens=add_special_tokens, return_tensors="pt" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i understand why you wanted it to return pt by default/ We could also have a "bool" return_tensors=True to return pt tensors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all the pipelines, self.framework would be set to pt for torch models during init. So I simply removed self.framework and made it explicit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no no I mean because you have now to manually say "pt" I understand why you told me you wanna default to returning tensors in tokenizer haha
4069e64 to
9a41b8d
Compare
…#40760) * setup * start the purge * continue the purge * more and more * more * continue the quest: remove loading tf/jax checkpoints * style * fix configs * oups forgot conflict * continue * still grinding * always more * in tje zone * never stop * should fix doc * fic * fix * fix * fix tests * still tests * fix non-deterministic * style * remove last rebase issues * onnx configs * still on the grind * always more references * nearly the end * could it really be the end? * small fix * add converters back * post rebase * latest qwen * add back all converters * explicitly add functions in converters * re-add
…#40760) * setup * start the purge * continue the purge * more and more * more * continue the quest: remove loading tf/jax checkpoints * style * fix configs * oups forgot conflict * continue * still grinding * always more * in tje zone * never stop * should fix doc * fic * fix * fix * fix tests * still tests * fix non-deterministic * style * remove last rebase issues * onnx configs * still on the grind * always more references * nearly the end * could it really be the end? * small fix * add converters back * post rebase * latest qwen * add back all converters * explicitly add functions in converters * re-add
What does this PR do?
Apart from obvious tf/jax support, I believe the following should be the only potential breaking changes to torch-only code:
frameworkargument anymoreframeworkargument anymoreIt may break current torch code if users do
framework="pt"explicitly, but it's a necessary change. It makes no sense to keep those arguments, as the only framework working for those objects is nowtorch. Would be weird to keep it only for BC, as we are breaking the support anyway.Note: I did not remove traces of tensorflow/jax in docs
.md(markdown) files for now, as this PR is already enormous. It's a very tedious task, and moreover a lot of doc is written in another alphabet that I cannot read at all. Will be done in a subsequent PR, hopefully with the help of AI (should be a perfect fit for that)