Commit ecc4f1bd authored by LysandreJik's avatar LysandreJik
Browse files

XLM use_lang_embedding flag in run_generation

parent c2c2ca0f
...@@ -177,7 +177,8 @@ def main(): ...@@ -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:
......
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