Instructions to use petros/bert-base-cypriot-uncased-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use petros/bert-base-cypriot-uncased-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="petros/bert-base-cypriot-uncased-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("petros/bert-base-cypriot-uncased-v1") model = AutoModelForMaskedLM.from_pretrained("petros/bert-base-cypriot-uncased-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -80,11 +80,11 @@ print(tokenizer_cypriot.convert_ids_to_tokens(outputs[0, 2].max(0)[1].item())) #
|
|
| 80 |
|
| 81 |
# ================ EXAMPLE 2 ================
|
| 82 |
text_2 = 'Eίσαι μια [MASK].'
|
| 83 |
-
input_ids =
|
| 84 |
-
print(
|
| 85 |
|
| 86 |
-
outputs =
|
| 87 |
-
print(
|
| 88 |
|
| 89 |
```
|
| 90 |
|
|
|
|
| 80 |
|
| 81 |
# ================ EXAMPLE 2 ================
|
| 82 |
text_2 = 'Eίσαι μια [MASK].'
|
| 83 |
+
input_ids = tokenizer_cypriot.encode(text_2)
|
| 84 |
+
print(tokenizer_cypriot.convert_ids_to_tokens(input_ids)) #['[CLS]', 'eισ', '##αι', 'μια', '[MASK]', '.', '[SEP]']
|
| 85 |
|
| 86 |
+
outputs = lm_model_cypriot(torch.tensor([input_ids]))[0]
|
| 87 |
+
print(tokenizer_cypriot.convert_ids_to_tokens(outputs[0, 4].max(0)[1].item())) # χαρα
|
| 88 |
|
| 89 |
```
|
| 90 |
|