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
fa963ecc
Commit
fa963ecc
authored
Nov 21, 2019
by
Evpok Padding
Committed by
Lysandre Debut
Nov 25, 2019
Browse files
if→elif
parent
c8eb8157
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
transformers/modeling_auto.py
transformers/modeling_auto.py
+2
-2
No files found.
transformers/modeling_auto.py
View file @
fa963ecc
...
...
@@ -271,7 +271,7 @@ class AutoModelWithLMHead(object):
"""
if
'distilbert'
in
pretrained_model_name_or_path
:
return
DistilBertForMaskedLM
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
if
'camembert'
in
pretrained_model_name_or_path
:
el
if
'camembert'
in
pretrained_model_name_or_path
:
return
CamembertForMaskedLM
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
elif
'roberta'
in
pretrained_model_name_or_path
:
return
RobertaForMaskedLM
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
...
...
@@ -394,7 +394,7 @@ class AutoModelForSequenceClassification(object):
"""
if
'distilbert'
in
pretrained_model_name_or_path
:
return
DistilBertForSequenceClassification
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
if
'camembert'
in
pretrained_model_name_or_path
:
el
if
'camembert'
in
pretrained_model_name_or_path
:
return
CamembertForSequenceClassification
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
elif
'roberta'
in
pretrained_model_name_or_path
:
return
RobertaForSequenceClassification
.
from_pretrained
(
pretrained_model_name_or_path
,
*
model_args
,
**
kwargs
)
...
...
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