Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
28a30af6
Commit
28a30af6
authored
Sep 24, 2019
by
thomwolf
Browse files
fix auto models
parent
de203853
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
pytorch_transformers/modeling_tf_auto.py
pytorch_transformers/modeling_tf_auto.py
+3
-3
No files found.
pytorch_transformers/modeling_tf_auto.py
View file @
28a30af6
...
@@ -22,7 +22,7 @@ from .modeling_tf_bert import TFBertModel, TFBertForMaskedLM, TFBertForSequenceC
...
@@ -22,7 +22,7 @@ from .modeling_tf_bert import TFBertModel, TFBertForMaskedLM, TFBertForSequenceC
from
.modeling_tf_openai
import
TFOpenAIGPTModel
,
TFOpenAIGPTLMHeadModel
from
.modeling_tf_openai
import
TFOpenAIGPTModel
,
TFOpenAIGPTLMHeadModel
from
.modeling_tf_gpt2
import
TFGPT2Model
,
TFGPT2LMHeadModel
from
.modeling_tf_gpt2
import
TFGPT2Model
,
TFGPT2LMHeadModel
from
.modeling_tf_transfo_xl
import
TFTransfoXLModel
,
TFTransfoXLLMHeadModel
from
.modeling_tf_transfo_xl
import
TFTransfoXLModel
,
TFTransfoXLLMHeadModel
from
.modeling_tf_xlnet
import
TFXLNetModel
,
TFXLNetLMHeadModel
,
TFXLNetForSequenceClassification
,
TFXLNetForQuestionAnswering
from
.modeling_tf_xlnet
import
TFXLNetModel
,
TFXLNetLMHeadModel
,
TFXLNetForSequenceClassification
,
TFXLNetForQuestionAnswering
Simple
from
.modeling_tf_xlm
import
TFXLMModel
,
TFXLMWithLMHeadModel
,
TFXLMForSequenceClassification
,
TFXLMForQuestionAnsweringSimple
from
.modeling_tf_xlm
import
TFXLMModel
,
TFXLMWithLMHeadModel
,
TFXLMForSequenceClassification
,
TFXLMForQuestionAnsweringSimple
from
.modeling_tf_roberta
import
TFRobertaModel
,
TFRobertaForMaskedLM
,
TFRobertaForSequenceClassification
from
.modeling_tf_roberta
import
TFRobertaModel
,
TFRobertaForMaskedLM
,
TFRobertaForSequenceClassification
from
.modeling_tf_distilbert
import
TFDistilBertModel
,
TFDistilBertForQuestionAnswering
,
TFDistilBertForMaskedLM
,
TFDistilBertForSequenceClassification
from
.modeling_tf_distilbert
import
TFDistilBertModel
,
TFDistilBertForQuestionAnswering
,
TFDistilBertForMaskedLM
,
TFDistilBertForSequenceClassification
...
@@ -493,9 +493,9 @@ class TFAutoModelForQuestionAnswering(object):
...
@@ -493,9 +493,9 @@ class TFAutoModelForQuestionAnswering(object):
elif
'bert'
in
pretrained_model_name_or_path
:
elif
'bert'
in
pretrained_model_name_or_path
:
return
TFBertForQuestionAnswering
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
return
TFBertForQuestionAnswering
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
elif
'xlnet'
in
pretrained_model_name_or_path
:
elif
'xlnet'
in
pretrained_model_name_or_path
:
return
TFXLNetForQuestionAnswering
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
return
TFXLNetForQuestionAnswering
Simple
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
elif
'xlm'
in
pretrained_model_name_or_path
:
elif
'xlm'
in
pretrained_model_name_or_path
:
return
TFXLMForQuestionAnswering
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
return
TFXLMForQuestionAnswering
Simple
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
raise
ValueError
(
"Unrecognized model identifier in {}. Should contains one of "
raise
ValueError
(
"Unrecognized model identifier in {}. Should contains one of "
"'bert', 'xlnet', 'xlm'"
.
format
(
pretrained_model_name_or_path
))
"'bert', 'xlnet', 'xlm'"
.
format
(
pretrained_model_name_or_path
))
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