helenai's picture
Add distilbert SST2 NNCF model
fcff3e3
---
language: en
license: apache-2.0
datasets:
- sst2
- glue
tags:
- openvino
---
## distilbert-base-uncased-finetuned-sst-2-english
[distilbert-base-uncased-finetuned-sst-2-english](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english) quantized with NNCF PTQ and exported to the OpenVINO IR.
**Model Description:** l is This model reaches an accuracy of 90.0 on the validation set. See [ov\_config.json](./ov_config.json) for the quantization config.
## Usage example
You can use this model with Transformers *pipeline*.
```python
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 = "He's a dreadful magician."
outputs = cls_pipe(text)
print(outputs)
```
Example output:
```bash
[{'label': 'NEGATIVE', 'score': 0.9929909706115723}]
```