-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Added TF TransfoXL Sequence Classification #9169
Added TF TransfoXL Sequence Classification #9169
Conversation
…il6/transformers into tf_transfoxl_seq_classifier
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 LGTM. @jplu if you have nothing to say, feel free to merge the PR.
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.
Meant to approve, finger slipped.
tests/test_modeling_tf_transfo_xl.py
Outdated
@@ -131,6 +141,12 @@ def create_and_check_transfo_xl_lm_head(self, config, input_ids_1, input_ids_2, | |||
[(self.mem_len, self.batch_size, self.hidden_size)] * self.num_hidden_layers, | |||
) | |||
|
|||
def create_and_check_transfo_xl_for_sequence_classification(self, config, input_ids_1, input_ids_2, lm_labels): | |||
config.num_labels = self.num_labels |
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.
@LysandreJik I have defined 'num_labels' here.
Now,I'll move it to 'prepare_config_and_inputs'
Added num_labels to config level
Added num_labels to config level
…il6/transformers into tf_transfoxl_seq_classifier
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
This PR implements Sequence classification for TF TransfoXL model.
TFTransfoXLForSequenceClassification uses the last token in order to do the classification, as other causal models (e.g. GPT-1 ,GPT-2) do.
Fixes #7623
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
@LysandreJik @jplu