harsh-deepchecks
commited on
Commit
•
563b894
1
Parent(s):
96e0673
Updated Readme.md
Browse files
README.md
CHANGED
@@ -1,3 +1,35 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- toxicity
|
6 |
license: cc-by-nc-sa-4.0
|
7 |
---
|
8 |
+
|
9 |
+
This model is an ONNX optimized variant of the original [roberta_toxicity_classifier](https://huggingface.co/s-nlp/roberta_toxicity_classifier) 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/roberta_toxicity_classifier_onnx')
|
20 |
+
model = ORTModelForSequenceClassification.from_pretrained('Deepchecks/roberta_toxicity_classifier_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
|