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
2a4ef098
Commit
2a4ef098
authored
Dec 09, 2019
by
LysandreJik
Browse files
Add ALBERT and XLM to SQuAD script
parent
00c4e395
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
examples/run_squad.py
examples/run_squad.py
+5
-2
No files found.
examples/run_squad.py
View file @
2a4ef098
...
@@ -44,7 +44,9 @@ from transformers import (WEIGHTS_NAME, BertConfig,
...
@@ -44,7 +44,9 @@ from transformers import (WEIGHTS_NAME, BertConfig,
XLNetForQuestionAnswering
,
XLNetForQuestionAnswering
,
XLNetTokenizer
,
XLNetTokenizer
,
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
,
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
,
AlbertConfig
,
AlbertForQuestionAnswering
,
AlbertTokenizer
)
AlbertConfig
,
AlbertForQuestionAnswering
,
AlbertTokenizer
,
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
,
)
from
transformers
import
AdamW
,
get_linear_schedule_with_warmup
,
squad_convert_examples_to_features
from
transformers
import
AdamW
,
get_linear_schedule_with_warmup
,
squad_convert_examples_to_features
...
@@ -58,7 +60,8 @@ MODEL_CLASSES = {
...
@@ -58,7 +60,8 @@ MODEL_CLASSES = {
'xlnet'
:
(
XLNetConfig
,
XLNetForQuestionAnswering
,
XLNetTokenizer
),
'xlnet'
:
(
XLNetConfig
,
XLNetForQuestionAnswering
,
XLNetTokenizer
),
'xlm'
:
(
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
),
'xlm'
:
(
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
),
'distilbert'
:
(
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
),
'distilbert'
:
(
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
),
'albert'
:
(
AlbertConfig
,
AlbertForQuestionAnswering
,
AlbertTokenizer
)
'albert'
:
(
AlbertConfig
,
AlbertForQuestionAnswering
,
AlbertTokenizer
),
'xlm'
:
(
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
)
}
}
def
set_seed
(
args
):
def
set_seed
(
args
):
...
...
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