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
c225e872
"templates/vscode:/vscode.git/clone" did not exist on "64ca855617b5ebfaea9e4ad405888e559068085f"
Unverified
Commit
c225e872
authored
Aug 27, 2020
by
Tom Grek
Committed by
GitHub
Aug 27, 2020
Browse files
Fix it to work with BART (#6756)
parent
0d2c111a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/question-answering/run_squad.py
examples/question-answering/run_squad.py
+2
-2
No files found.
examples/question-answering/run_squad.py
View file @
c225e872
...
...
@@ -187,7 +187,7 @@ def train(args, train_dataset, model, tokenizer):
"end_positions"
:
batch
[
4
],
}
if
args
.
model_type
in
[
"xlm"
,
"roberta"
,
"distilbert"
,
"camembert"
]:
if
args
.
model_type
in
[
"xlm"
,
"roberta"
,
"distilbert"
,
"camembert"
,
"bart"
]:
del
inputs
[
"token_type_ids"
]
if
args
.
model_type
in
[
"xlnet"
,
"xlm"
]:
...
...
@@ -300,7 +300,7 @@ def evaluate(args, model, tokenizer, prefix=""):
"token_type_ids"
:
batch
[
2
],
}
if
args
.
model_type
in
[
"xlm"
,
"roberta"
,
"distilbert"
,
"camembert"
]:
if
args
.
model_type
in
[
"xlm"
,
"roberta"
,
"distilbert"
,
"camembert"
,
"bart"
]:
del
inputs
[
"token_type_ids"
]
feature_indices
=
batch
[
3
]
...
...
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