This repository was archived by the owner on Sep 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 814
Prepare T5 Model for Language Generation #1862
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parmeet
approved these changes
Jul 27, 2022
Contributor
parmeet
left a comment
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.
Thanks for adding Language generation capability to T5 model, overall LGTM!
Nayef211
approved these changes
Jul 27, 2022
Contributor
Nayef211
left a comment
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.
LGTM
25 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add a T5 model that can be used for language generation tasks.
Process
For language generation, the outputs of the decoder pass through a linear layer which projects the hidden states to the vocab. The boolean parameter
linear_headwas added toT5Conf, which allows the user to specify if they want the model to include this final linear layer and return its output. A bundler object,T5_BASE_GENERATIONwas also created to instantiate such a model using pre-trained weights under the base configuration. These weights have been uploaded to the AWS and Manifold buckets ast5.base.generation.pt.Testing
Tests that were used to check the outputs of the
T5_BASEandT5_BASE_ENCODERmodels are also used to test the outputs ofT5_BASE_GENERATION. Additionally, the linear head in the generation models allows us to compute the cross entropy loss. Therefore, we can now also test the train functionality.pytest test/prototype/integration_tests/test_models.pypytest test/prototype/models/test_models.pyFollow-Up
test/prototype/models/test_models.py::TestModels::test_t5_bundler_trainappears to be failing in select environments (ex. for the most recent commit it failed inwindows_py3.8andmacos_py3.10, though the exact environment(s) it fails in varies with each new, yet unrelated, commit. It's unclear what the source of this failure is, and why it doesn't consistantly fail in the same environments.