Commit
·
58c3447
1
Parent(s):
944aaeb
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- formality
|
| 6 |
+
license: cc-by-nc-sa-4.0
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
This model is an ONNX optimized variant of the original [parrot_fluency_model](https://huggingface.co/prithivida/parrot_fluency_model) model.
|
| 10 |
+
The model is specifically optimized for GPUs and may have performance differences when executed on CPUs.
|
| 11 |
+
|
| 12 |
+
## How to use
|
| 13 |
+
```python
|
| 14 |
+
from transformers import AutoTokenizer
|
| 15 |
+
from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 16 |
+
from optimum.pipelines import pipeline
|
| 17 |
+
|
| 18 |
+
# load tokenizer and model weights
|
| 19 |
+
tokenizer = AutoTokenizer.from_pretrained('Deepchecks/parrot_fluency_model_onnx')
|
| 20 |
+
model = ORTModelForSequenceClassification.from_pretrained('Deepchecks/parrot_fluency_model_onnx')
|
| 21 |
+
|
| 22 |
+
# prepare the pipeline and generate inferences
|
| 23 |
+
pip = pipeline(task='text-classification', model=onnx_model, tokenizer=tokenizer, device=device, accelerator="ort")
|
| 24 |
+
res = pip(user_inputs, batch_size=64, truncation="only_first")
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Licensing Information
|
| 29 |
+
|
| 30 |
+
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
|
| 31 |
+
|
| 32 |
+
[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
|
| 33 |
+
|
| 34 |
+
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
|
| 35 |
+
[cc-by-nc-sa-image]: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png
|