Skip to content

Commit

Permalink
if statement to elif statement
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjiwon committed Feb 13, 2019
1 parent f53f080 commit c8c5bb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 5-2.BERT/BERT-Torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def make_batch():
masked_tokens.append(input_ids[pos])
if random() < 0.8: # 80%
input_ids[pos] = word_dict['[MASK]'] # make mask
if random() < 0.5: # 10%
elif random() < 0.5: # 10%
index = randint(0, vocab_size - 1) # random index in vocabulary
input_ids[pos] = word_dict[number_dict[index]] # replace

Expand Down
2 changes: 1 addition & 1 deletion 5-2.BERT/BERT_Torch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
" masked_tokens.append(input_ids[pos])\n",
" if random() < 0.8: # 80%\n",
" input_ids[pos] = word_dict['[MASK]'] # make mask\n",
" if random() < 0.5: # 10%\n",
" elif random() < 0.5: # 10%\n",
" index = randint(0, vocab_size - 1) # random index in vocabulary\n",
" input_ids[pos] = word_dict[number_dict[index]] # replace\n",
"\n",
Expand Down

0 comments on commit c8c5bb6

Please sign in to comment.