Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
8438bab3
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "f4f4946836dd029b2015ffc59db3edac0f6edd45"
Unverified
Commit
8438bab3
authored
Jul 02, 2020
by
Pierric Cistac
Committed by
GitHub
Jul 02, 2020
Browse files
Fix roberta model ordering for TFAutoModel (#5414)
parent
6b735a72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/transformers/modeling_tf_auto.py
src/transformers/modeling_tf_auto.py
+7
-7
No files found.
src/transformers/modeling_tf_auto.py
View file @
8438bab3
...
@@ -141,7 +141,6 @@ logger = logging.getLogger(__name__)
...
@@ -141,7 +141,6 @@ logger = logging.getLogger(__name__)
TF_MODEL_MAPPING
=
OrderedDict
(
TF_MODEL_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertModel
),
(
AlbertConfig
,
TFAlbertModel
),
(
BertConfig
,
TFBertModel
),
(
CamembertConfig
,
TFCamembertModel
),
(
CamembertConfig
,
TFCamembertModel
),
(
CTRLConfig
,
TFCTRLModel
),
(
CTRLConfig
,
TFCTRLModel
),
(
DistilBertConfig
,
TFDistilBertModel
),
(
DistilBertConfig
,
TFDistilBertModel
),
...
@@ -151,6 +150,7 @@ TF_MODEL_MAPPING = OrderedDict(
...
@@ -151,6 +150,7 @@ TF_MODEL_MAPPING = OrderedDict(
(
MobileBertConfig
,
TFMobileBertModel
),
(
MobileBertConfig
,
TFMobileBertModel
),
(
OpenAIGPTConfig
,
TFOpenAIGPTModel
),
(
OpenAIGPTConfig
,
TFOpenAIGPTModel
),
(
RobertaConfig
,
TFRobertaModel
),
(
RobertaConfig
,
TFRobertaModel
),
(
BertConfig
,
TFBertModel
),
(
T5Config
,
TFT5Model
),
(
T5Config
,
TFT5Model
),
(
TransfoXLConfig
,
TFTransfoXLModel
),
(
TransfoXLConfig
,
TFTransfoXLModel
),
(
XLMConfig
,
TFXLMModel
),
(
XLMConfig
,
TFXLMModel
),
...
@@ -162,7 +162,6 @@ TF_MODEL_MAPPING = OrderedDict(
...
@@ -162,7 +162,6 @@ TF_MODEL_MAPPING = OrderedDict(
TF_MODEL_FOR_PRETRAINING_MAPPING
=
OrderedDict
(
TF_MODEL_FOR_PRETRAINING_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForPreTraining
),
(
AlbertConfig
,
TFAlbertForPreTraining
),
(
BertConfig
,
TFBertForPreTraining
),
(
CamembertConfig
,
TFCamembertForMaskedLM
),
(
CamembertConfig
,
TFCamembertForMaskedLM
),
(
CTRLConfig
,
TFCTRLLMHeadModel
),
(
CTRLConfig
,
TFCTRLLMHeadModel
),
(
DistilBertConfig
,
TFDistilBertForMaskedLM
),
(
DistilBertConfig
,
TFDistilBertForMaskedLM
),
...
@@ -172,6 +171,7 @@ TF_MODEL_FOR_PRETRAINING_MAPPING = OrderedDict(
...
@@ -172,6 +171,7 @@ TF_MODEL_FOR_PRETRAINING_MAPPING = OrderedDict(
(
MobileBertConfig
,
TFMobileBertForPreTraining
),
(
MobileBertConfig
,
TFMobileBertForPreTraining
),
(
OpenAIGPTConfig
,
TFOpenAIGPTLMHeadModel
),
(
OpenAIGPTConfig
,
TFOpenAIGPTLMHeadModel
),
(
RobertaConfig
,
TFRobertaForMaskedLM
),
(
RobertaConfig
,
TFRobertaForMaskedLM
),
(
BertConfig
,
TFBertForPreTraining
),
(
T5Config
,
TFT5ForConditionalGeneration
),
(
T5Config
,
TFT5ForConditionalGeneration
),
(
TransfoXLConfig
,
TFTransfoXLLMHeadModel
),
(
TransfoXLConfig
,
TFTransfoXLLMHeadModel
),
(
XLMConfig
,
TFXLMWithLMHeadModel
),
(
XLMConfig
,
TFXLMWithLMHeadModel
),
...
@@ -183,7 +183,6 @@ TF_MODEL_FOR_PRETRAINING_MAPPING = OrderedDict(
...
@@ -183,7 +183,6 @@ TF_MODEL_FOR_PRETRAINING_MAPPING = OrderedDict(
TF_MODEL_WITH_LM_HEAD_MAPPING
=
OrderedDict
(
TF_MODEL_WITH_LM_HEAD_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForMaskedLM
),
(
AlbertConfig
,
TFAlbertForMaskedLM
),
(
BertConfig
,
TFBertForMaskedLM
),
(
CamembertConfig
,
TFCamembertForMaskedLM
),
(
CamembertConfig
,
TFCamembertForMaskedLM
),
(
CTRLConfig
,
TFCTRLLMHeadModel
),
(
CTRLConfig
,
TFCTRLLMHeadModel
),
(
DistilBertConfig
,
TFDistilBertForMaskedLM
),
(
DistilBertConfig
,
TFDistilBertForMaskedLM
),
...
@@ -193,6 +192,7 @@ TF_MODEL_WITH_LM_HEAD_MAPPING = OrderedDict(
...
@@ -193,6 +192,7 @@ TF_MODEL_WITH_LM_HEAD_MAPPING = OrderedDict(
(
MobileBertConfig
,
TFMobileBertForMaskedLM
),
(
MobileBertConfig
,
TFMobileBertForMaskedLM
),
(
OpenAIGPTConfig
,
TFOpenAIGPTLMHeadModel
),
(
OpenAIGPTConfig
,
TFOpenAIGPTLMHeadModel
),
(
RobertaConfig
,
TFRobertaForMaskedLM
),
(
RobertaConfig
,
TFRobertaForMaskedLM
),
(
BertConfig
,
TFBertForMaskedLM
),
(
T5Config
,
TFT5ForConditionalGeneration
),
(
T5Config
,
TFT5ForConditionalGeneration
),
(
TransfoXLConfig
,
TFTransfoXLLMHeadModel
),
(
TransfoXLConfig
,
TFTransfoXLLMHeadModel
),
(
XLMConfig
,
TFXLMWithLMHeadModel
),
(
XLMConfig
,
TFXLMWithLMHeadModel
),
...
@@ -204,12 +204,12 @@ TF_MODEL_WITH_LM_HEAD_MAPPING = OrderedDict(
...
@@ -204,12 +204,12 @@ TF_MODEL_WITH_LM_HEAD_MAPPING = OrderedDict(
TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING
=
OrderedDict
(
TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForMultipleChoice
),
(
AlbertConfig
,
TFAlbertForMultipleChoice
),
(
BertConfig
,
TFBertForMultipleChoice
),
(
CamembertConfig
,
TFCamembertForMultipleChoice
),
(
CamembertConfig
,
TFCamembertForMultipleChoice
),
(
DistilBertConfig
,
TFDistilBertForMultipleChoice
),
(
DistilBertConfig
,
TFDistilBertForMultipleChoice
),
(
FlaubertConfig
,
TFFlaubertForMultipleChoice
),
(
FlaubertConfig
,
TFFlaubertForMultipleChoice
),
(
MobileBertConfig
,
TFMobileBertForMultipleChoice
),
(
MobileBertConfig
,
TFMobileBertForMultipleChoice
),
(
RobertaConfig
,
TFRobertaForMultipleChoice
),
(
RobertaConfig
,
TFRobertaForMultipleChoice
),
(
BertConfig
,
TFBertForMultipleChoice
),
(
XLMConfig
,
TFXLMForMultipleChoice
),
(
XLMConfig
,
TFXLMForMultipleChoice
),
(
XLMRobertaConfig
,
TFXLMRobertaForMultipleChoice
),
(
XLMRobertaConfig
,
TFXLMRobertaForMultipleChoice
),
(
XLNetConfig
,
TFXLNetForMultipleChoice
),
(
XLNetConfig
,
TFXLNetForMultipleChoice
),
...
@@ -219,13 +219,13 @@ TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING = OrderedDict(
...
@@ -219,13 +219,13 @@ TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING = OrderedDict(
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
=
OrderedDict
(
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForQuestionAnswering
),
(
AlbertConfig
,
TFAlbertForQuestionAnswering
),
(
BertConfig
,
TFBertForQuestionAnswering
),
(
CamembertConfig
,
TFCamembertForQuestionAnswering
),
(
CamembertConfig
,
TFCamembertForQuestionAnswering
),
(
DistilBertConfig
,
TFDistilBertForQuestionAnswering
),
(
DistilBertConfig
,
TFDistilBertForQuestionAnswering
),
(
ElectraConfig
,
TFElectraForQuestionAnswering
),
(
ElectraConfig
,
TFElectraForQuestionAnswering
),
(
FlaubertConfig
,
TFFlaubertForQuestionAnsweringSimple
),
(
FlaubertConfig
,
TFFlaubertForQuestionAnsweringSimple
),
(
MobileBertConfig
,
TFMobileBertForQuestionAnswering
),
(
MobileBertConfig
,
TFMobileBertForQuestionAnswering
),
(
RobertaConfig
,
TFRobertaForQuestionAnswering
),
(
RobertaConfig
,
TFRobertaForQuestionAnswering
),
(
BertConfig
,
TFBertForQuestionAnswering
),
(
XLMConfig
,
TFXLMForQuestionAnsweringSimple
),
(
XLMConfig
,
TFXLMForQuestionAnsweringSimple
),
(
XLMRobertaConfig
,
TFXLMRobertaForQuestionAnswering
),
(
XLMRobertaConfig
,
TFXLMRobertaForQuestionAnswering
),
(
XLNetConfig
,
TFXLNetForQuestionAnsweringSimple
),
(
XLNetConfig
,
TFXLNetForQuestionAnsweringSimple
),
...
@@ -235,12 +235,12 @@ TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING = OrderedDict(
...
@@ -235,12 +235,12 @@ TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING = OrderedDict(
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
=
OrderedDict
(
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForSequenceClassification
),
(
AlbertConfig
,
TFAlbertForSequenceClassification
),
(
BertConfig
,
TFBertForSequenceClassification
),
(
CamembertConfig
,
TFCamembertForSequenceClassification
),
(
CamembertConfig
,
TFCamembertForSequenceClassification
),
(
DistilBertConfig
,
TFDistilBertForSequenceClassification
),
(
DistilBertConfig
,
TFDistilBertForSequenceClassification
),
(
FlaubertConfig
,
TFFlaubertForSequenceClassification
),
(
FlaubertConfig
,
TFFlaubertForSequenceClassification
),
(
MobileBertConfig
,
TFMobileBertForSequenceClassification
),
(
MobileBertConfig
,
TFMobileBertForSequenceClassification
),
(
RobertaConfig
,
TFRobertaForSequenceClassification
),
(
RobertaConfig
,
TFRobertaForSequenceClassification
),
(
BertConfig
,
TFBertForSequenceClassification
),
(
XLMConfig
,
TFXLMForSequenceClassification
),
(
XLMConfig
,
TFXLMForSequenceClassification
),
(
XLMRobertaConfig
,
TFXLMRobertaForSequenceClassification
),
(
XLMRobertaConfig
,
TFXLMRobertaForSequenceClassification
),
(
XLNetConfig
,
TFXLNetForSequenceClassification
),
(
XLNetConfig
,
TFXLNetForSequenceClassification
),
...
@@ -250,13 +250,13 @@ TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING = OrderedDict(
...
@@ -250,13 +250,13 @@ TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING = OrderedDict(
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
=
OrderedDict
(
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
=
OrderedDict
(
[
[
(
AlbertConfig
,
TFAlbertForTokenClassification
),
(
AlbertConfig
,
TFAlbertForTokenClassification
),
(
BertConfig
,
TFBertForTokenClassification
),
(
CamembertConfig
,
TFCamembertForTokenClassification
),
(
CamembertConfig
,
TFCamembertForTokenClassification
),
(
DistilBertConfig
,
TFDistilBertForTokenClassification
),
(
DistilBertConfig
,
TFDistilBertForTokenClassification
),
(
ElectraConfig
,
TFElectraForTokenClassification
),
(
ElectraConfig
,
TFElectraForTokenClassification
),
(
FlaubertConfig
,
TFFlaubertForTokenClassification
),
(
FlaubertConfig
,
TFFlaubertForTokenClassification
),
(
MobileBertConfig
,
TFMobileBertForTokenClassification
),
(
MobileBertConfig
,
TFMobileBertForTokenClassification
),
(
RobertaConfig
,
TFRobertaForTokenClassification
),
(
RobertaConfig
,
TFRobertaForTokenClassification
),
(
BertConfig
,
TFBertForTokenClassification
),
(
XLMConfig
,
TFXLMForTokenClassification
),
(
XLMConfig
,
TFXLMForTokenClassification
),
(
XLMRobertaConfig
,
TFXLMRobertaForTokenClassification
),
(
XLMRobertaConfig
,
TFXLMRobertaForTokenClassification
),
(
XLNetConfig
,
TFXLNetForTokenClassification
),
(
XLNetConfig
,
TFXLNetForTokenClassification
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment