mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 03:01:07 +06:00
XLM use_lang_embedding flag in run_generation
This commit is contained in:
parent
c2c2ca0fdb
commit
ecc4f1bdfa
@ -177,7 +177,8 @@ def main():
|
|||||||
while True:
|
while True:
|
||||||
xlm_lang = None
|
xlm_lang = None
|
||||||
# XLM Language usage detailed in the issues #1414
|
# XLM Language usage detailed in the issues #1414
|
||||||
if args.model_type in ["xlm"] and hasattr(tokenizer, 'lang2id'):
|
if args.model_type in ["xlm"] and hasattr(tokenizer, 'lang2id') and hasattr(model.config, 'use_lang_emb') \
|
||||||
|
and model.config.use_lang_emb:
|
||||||
if args.xlm_lang:
|
if args.xlm_lang:
|
||||||
language = args.xlm_lang
|
language = args.xlm_lang
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user