mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-25 07:18:58 +06:00
set tgt_lang of MBart Tokenizer for summarization (#10205)
This commit is contained in:
parent
5c2d66a2f5
commit
df1b0fb54d
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user