Text Classification
Transformers
Safetensors
Spanish
xlm-roberta
nli
spanish
causal
esnlir
artifact-detection
partial-input
text-embeddings-inference
Instructions to use Flaglab/ESNLIR-XLM-RoBERTa-premise-only with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Flaglab/ESNLIR-XLM-RoBERTa-premise-only with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Flaglab/ESNLIR-XLM-RoBERTa-premise-only")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Flaglab/ESNLIR-XLM-RoBERTa-premise-only") model = AutoModelForSequenceClassification.from_pretrained("Flaglab/ESNLIR-XLM-RoBERTa-premise-only", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Load tokenizer from the repo now that it ships with one
Browse files
README.md
CHANGED
|
@@ -91,7 +91,7 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
| 91 |
import torch
|
| 92 |
|
| 93 |
name = "Flaglab/ESNLIR-XLM-RoBERTa-premise-only"
|
| 94 |
-
tok = AutoTokenizer.from_pretrained(
|
| 95 |
model = AutoModelForSequenceClassification.from_pretrained(name)
|
| 96 |
|
| 97 |
# premise only, by design
|
|
@@ -104,8 +104,9 @@ with torch.no_grad():
|
|
| 104 |
print(model.config.id2label[int(logits.argmax(-1))])
|
| 105 |
```
|
| 106 |
|
| 107 |
-
> The tokenizer
|
| 108 |
-
> `FacebookAI/xlm-roberta-base`
|
|
|
|
| 109 |
|
| 110 |
## Citation
|
| 111 |
|
|
|
|
| 91 |
import torch
|
| 92 |
|
| 93 |
name = "Flaglab/ESNLIR-XLM-RoBERTa-premise-only"
|
| 94 |
+
tok = AutoTokenizer.from_pretrained(name)
|
| 95 |
model = AutoModelForSequenceClassification.from_pretrained(name)
|
| 96 |
|
| 97 |
# premise only, by design
|
|
|
|
| 104 |
print(model.config.id2label[int(logits.argmax(-1))])
|
| 105 |
```
|
| 106 |
|
| 107 |
+
> The tokenizer bundled here is an unmodified copy of the one from
|
| 108 |
+
> [`FacebookAI/xlm-roberta-base`](https://huggingface.co/FacebookAI/xlm-roberta-base); vocabulary size matches this model's
|
| 109 |
+
> embedding table exactly.
|
| 110 |
|
| 111 |
## Citation
|
| 112 |
|