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
[T5] allow config.decoder_layers to control decoder size #7409
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d8f1724
Working assymmetrical T5
sshleifer 14dd629
rename decoder_layers -> num_decoder_layers
sshleifer fe4d531
Fix docstring
sshleifer 441ade1
Merge branch 'master' into asymmetrical-t5
sshleifer ac38a32
Allow creation of asymmetric t5 students
sshleifer File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,8 @@ class T5Config(PretrainedConfig): | |
Size of the intermediate feed forward layer in each :obj:`T5Block`. | ||
num_layers (:obj:`int`, `optional`, defaults to 6): | ||
Number of hidden layers in the Transformer encoder. | ||
decoder_layers (:obj:`int`, `optional`, defaults to num_layers): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented defaults should match the signature. It will eventually default to
|
||
Number of hidden layers in the Transformer decoder. | ||
num_heads (:obj:`int`, `optional`, defaults to 8): | ||
Number of attention heads for each attention layer in | ||
the Transformer encoder. | ||
|
@@ -80,6 +82,7 @@ def __init__( | |
d_kv=64, | ||
d_ff=2048, | ||
num_layers=6, | ||
decoder_layers=None, | ||
num_heads=8, | ||
relative_attention_num_buckets=32, | ||
dropout_rate=0.1, | ||
|
@@ -102,6 +105,7 @@ def __init__( | |
self.d_kv = d_kv | ||
self.d_ff = d_ff | ||
self.num_layers = num_layers | ||
self.decoder_layers = decoder_layers if decoder_layers is not None else self.num_layers # default = symmetry | ||
self.num_heads = num_heads | ||
self.relative_attention_num_buckets = relative_attention_num_buckets | ||
self.dropout_rate = dropout_rate | ||
|
This file contains 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
This file contains 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
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.
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.
this was previously documented incorrectly. Now it is correct!