Downloads · 30 days
16
2% of all-time downloads
helenai/distilbert-base-uncased-finetuned-sst-2-english-ov-int8
distilbert-base-uncased-finetuned-sst-2-english-ov-int8 is a text classification model from helenai. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
distilbert-base-uncased-finetuned-sst-2-english quantized with NNCF PTQ and exported to OpenVINO IR.
Downloads · 30 days
16
2% of all-time downloads
All-time downloads
687
Public
Repo size
139 MB
Likes
0
Public
Click a slice to open those files.
.bin139 MB · 99%
From the Hugging Face model README
distilbert-base-uncased-finetuned-sst-2-english quantized with NNCF PTQ and exported to OpenVINO IR.
Model Description: This model reaches an accuracy of 90.0 on the validation set. See ov_config.json for the quantization config.
To install the requirements for using the OpenVINO backend, do:
pip install optimum[openvino]
This installs all necessary dependencies, including Transformers and OpenVINO.
NOTE: Python 3.7-3.9 are supported. A virtualenv is recommended.
You can use this model with a Transformers pipeline.
from transformers import AutoTokenizer, pipeline
from optimum.intel.openvino import OVModelForSequenceClassification
model_id = "helenai/distilbert-base-uncased-finetuned-sst-2-english-ov-int8"
model = OVModelForSequenceClassification.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
cls_pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
text = "OpenVINO is awesome!"
outputs = cls_pipe(text)
print(outputs)
Example output:
[{'label': 'POSITIVE', 'score': 0.9998594522476196}]