Skip to content
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

Generate: Export TF generate with a TF tokenizer #22310

Merged
merged 2 commits into from
Mar 22, 2023

Conversation

gante
Copy link
Member

@gante gante commented Mar 22, 2023

What does this PR do?

See #22254

As the title says, this PR adds the possibility to export TF generate with a TF-native tokenizer -- the full thing in a single TF graph 🤯

The missing piece was removing a redundant if before tf.while_cond -- tf.while_cond checks the condition before running the body, so the existing if before it was redundant. It was also the root cause behind the error in #22254, so removing it was a double win 🎉

A test was added to ensure we don't regress.

@gante gante requested a review from amyeroberts March 22, 2023 12:28
@gante
Copy link
Member Author

gante commented Mar 22, 2023

@Rocketknight1 no need to review, but FYI -- we can now compile the whole thing into a graph :D

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

Code is also cleaner --> extra win 🥳

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 22, 2023

The documentation is not available anymore as the PR was closed or merged.

@gante gante force-pushed the export_tf_generate_with_tokenizer branch from 96914db to db3f426 Compare March 22, 2023 14:04
@gante gante merged commit 12febc2 into huggingface:main Mar 22, 2023
@gante gante deleted the export_tf_generate_with_tokenizer branch March 22, 2023 15:00
@Rocketknight1
Copy link
Member

This is amazing!

raghavanone pushed a commit to raghavanone/transformers that referenced this pull request Apr 5, 2023
* Export TF generate with a TF tokenizer

* remove unused lines
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* Export TF generate with a TF tokenizer

* remove unused lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants