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
de8e14b6
Commit
de8e14b6
authored
Sep 11, 2019
by
LysandreJik
Browse files
Added DistilBERT to run_squad script
parent
88368c2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
examples/run_squad.py
examples/run_squad.py
+3
-1
No files found.
examples/run_squad.py
View file @
de8e14b6
...
@@ -37,7 +37,8 @@ from pytorch_transformers import (WEIGHTS_NAME, BertConfig,
...
@@ -37,7 +37,8 @@ from pytorch_transformers import (WEIGHTS_NAME, BertConfig,
XLMConfig
,
XLMForQuestionAnswering
,
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
,
XLNetConfig
,
XLMTokenizer
,
XLNetConfig
,
XLNetForQuestionAnswering
,
XLNetForQuestionAnswering
,
XLNetTokenizer
)
XLNetTokenizer
,
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
)
from
pytorch_transformers
import
AdamW
,
WarmupLinearSchedule
from
pytorch_transformers
import
AdamW
,
WarmupLinearSchedule
...
@@ -59,6 +60,7 @@ MODEL_CLASSES = {
...
@@ -59,6 +60,7 @@ MODEL_CLASSES = {
'bert'
:
(
BertConfig
,
BertForQuestionAnswering
,
BertTokenizer
),
'bert'
:
(
BertConfig
,
BertForQuestionAnswering
,
BertTokenizer
),
'xlnet'
:
(
XLNetConfig
,
XLNetForQuestionAnswering
,
XLNetTokenizer
),
'xlnet'
:
(
XLNetConfig
,
XLNetForQuestionAnswering
,
XLNetTokenizer
),
'xlm'
:
(
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
),
'xlm'
:
(
XLMConfig
,
XLMForQuestionAnswering
,
XLMTokenizer
),
'distilbert'
:
(
DistilBertConfig
,
DistilBertForQuestionAnswering
,
DistilBertTokenizer
)
}
}
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