From ce75b169bdab0978eed533d86b2776b02536c0ea Mon Sep 17 00:00:00 2001 From: tholor Date: Thu, 31 Jan 2019 11:42:06 +0100 Subject: [PATCH] avoid confusion of inplace masking of tokens_a / tokens_b --- examples/run_lm_finetuning.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/run_lm_finetuning.py b/examples/run_lm_finetuning.py index 35a2f797c7..db9179910e 100644 --- a/examples/run_lm_finetuning.py +++ b/examples/run_lm_finetuning.py @@ -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) - t1_random, t1_label = random_word(tokens_a, tokenizer) - t2_random, t2_label = random_word(tokens_b, tokenizer) + tokens_a, t1_label = random_word(tokens_a, tokenizer) + tokens_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])