Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ecc4f1bd
Commit
ecc4f1bd
authored
Oct 03, 2019
by
LysandreJik
Browse files
XLM use_lang_embedding flag in run_generation
parent
c2c2ca0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/run_generation.py
examples/run_generation.py
+2
-1
No files found.
examples/run_generation.py
View file @
ecc4f1bd
...
...
@@ -177,7 +177,8 @@ def main():
while
True
:
xlm_lang
=
None
# 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
:
language
=
args
.
xlm_lang
else
:
...
...
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