Instructions to use dicta-il/dictabert-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dicta-il/dictabert-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="dicta-il/dictabert-tiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("dicta-il/dictabert-tiny") model = AutoModelForMaskedLM.from_pretrained("dicta-il/dictabert-tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -27,7 +27,7 @@ output = model(tokenizer.encode(sentence, return_tensors='pt'))
|
|
| 27 |
# the [MASK] is the 7th token (including [CLS])
|
| 28 |
import torch
|
| 29 |
top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
|
| 30 |
-
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print
|
| 31 |
|
| 32 |
```
|
| 33 |
|
|
|
|
| 27 |
# the [MASK] is the 7th token (including [CLS])
|
| 28 |
import torch
|
| 29 |
top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
|
| 30 |
+
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print 注讘讜讚转讜 / 讛转诪讞讜转讜
|
| 31 |
|
| 32 |
```
|
| 33 |
|