RoBERTa
Collection
5 items • Updated
How to use Intel/roberta-base-mrpc-int8-dynamic-inc with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Intel/roberta-base-mrpc-int8-dynamic-inc") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Intel/roberta-base-mrpc-int8-dynamic-inc")
model = AutoModelForSequenceClassification.from_pretrained("Intel/roberta-base-mrpc-int8-dynamic-inc")This is an INT8 ONNX model quantized with Intel® Neural Compressor.
The original fp32 model comes from the fine-tuned model Intel/roberta-base-mrpc.
| INT8 | FP32 | |
|---|---|---|
| Accuracy (eval-f1) | 0.9085 | 0.9138 |
| Model size (MB) | 122 | 476 |
from optimum.onnxruntime import ORTModelForSequenceClassification
model = ORTModelForSequenceClassification.from_pretrained('Intel/roberta-base-mrpc-int8-dynamic')