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
ce75b169
Commit
ce75b169
authored
Jan 31, 2019
by
tholor
Browse files
avoid confusion of inplace masking of tokens_a / tokens_b
parent
0a9d7c7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
examples/run_lm_finetuning.py
examples/run_lm_finetuning.py
+2
-2
No files found.
examples/run_lm_finetuning.py
View file @
ce75b169
...
...
@@ -328,8 +328,8 @@ def convert_example_to_features(example, max_seq_length, tokenizer):
# Account for [CLS], [SEP], [SEP] with "- 3"
_truncate_seq_pair
(
tokens_a
,
tokens_b
,
max_seq_length
-
3
)
t
1_random
,
t1_label
=
random_word
(
tokens_a
,
tokenizer
)
t
2_random
,
t2_label
=
random_word
(
tokens_b
,
tokenizer
)
t
okens_a
,
t1_label
=
random_word
(
tokens_a
,
tokenizer
)
t
okens_b
,
t2_label
=
random_word
(
tokens_b
,
tokenizer
)
# concatenate lm labels and account for CLS, SEP, SEP
lm_label_ids
=
([
-
1
]
+
t1_label
+
[
-
1
]
+
t2_label
+
[
-
1
])
...
...
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