Update README.md
Browse files
README.md
CHANGED
@@ -23,6 +23,7 @@ sentence = '讘砖谞转 1948 讛砖诇讬诐 讗驻专讬诐 拽讬砖讜谉 讗转 [MASK] 讘驻讬住
|
|
23 |
|
24 |
output = model(tokenizer.encode(sentence, return_tensors='pt'))
|
25 |
# the [MASK] is the 7th token (including [CLS])
|
|
|
26 |
top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
|
27 |
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print 诇讬诪讜讚讬讜 / 讛转诪讞讜转讜
|
28 |
|
|
|
23 |
|
24 |
output = model(tokenizer.encode(sentence, return_tensors='pt'))
|
25 |
# the [MASK] is the 7th token (including [CLS])
|
26 |
+
import torch
|
27 |
top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
|
28 |
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print 诇讬诪讜讚讬讜 / 讛转诪讞讜转讜
|
29 |
|