"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "3318c246f3c9f7f513823e72318fe356790182b9"
Unverified Commit df1b0fb5 authored by Zhang Cheng's avatar Zhang Cheng Committed by GitHub
Browse files

set tgt_lang of MBart Tokenizer for summarization (#10205)

parent 5c2d66a2
...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment