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
df1b0fb5
Unverified
Commit
df1b0fb5
authored
Feb 16, 2021
by
Zhang Cheng
Committed by
GitHub
Feb 16, 2021
Browse files
set tgt_lang of MBart Tokenizer for summarization (#10205)
parent
5c2d66a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/seq2seq/run_seq2seq.py
examples/seq2seq/run_seq2seq.py
+1
-1
No files found.
examples/seq2seq/run_seq2seq.py
View file @
df1b0fb5
...
@@ -386,7 +386,7 @@ def main():
...
@@ -386,7 +386,7 @@ def main():
# For translation we set the codes of our source and target languages (only useful for mBART, the others will
# For translation we set the codes of our source and target languages (only useful for mBART, the others will
# ignore those attributes).
# ignore those attributes).
if
data_args
.
task
.
startswith
(
"translation"
):
if
data_args
.
task
.
startswith
(
"translation"
)
or
isinstance
(
tokenizer
,
(
MBartTokenizer
,
MBartTokenizerFast
))
:
if
data_args
.
source_lang
is
not
None
:
if
data_args
.
source_lang
is
not
None
:
tokenizer
.
src_lang
=
data_args
.
source_lang
tokenizer
.
src_lang
=
data_args
.
source_lang
if
data_args
.
target_lang
is
not
None
:
if
data_args
.
target_lang
is
not
None
:
...
...
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