Views
No views yet
banking77 dataset.The quantized model achieves 99.93% accuracy of the FP32 model
| latency | vanilla transformers | quantized optimum model | improvement |
|---|---|---|---|
| p95 | 63.24ms | 37.06ms | 1.71x |
| avg | 62.87ms | 37.93ms | 1.66x |
1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import pipeline, AutoTokenizer
3
4model = ORTModelForSequenceClassification.from_pretrained("lewtun/quantized-distilbert-banking77")
5tokenizer = AutoTokenizer.from_pretrained("lewtun/quantized-distilbert-banking77")
6
7classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
8classifier("What is the exchange rate like on this app?")