File size: 583 Bytes
c0e4108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
license: apache-2.0
language:
- en
metrics:
- accuracy
- f1
pipeline_tag: text-classification
---

```python
# transformers==4.29.1

from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSequenceClassification

onnx_model_path = "kevinng77/unsup_bert_L3"
tokenizer = AutoTokenizer.from_pretrained(onnx_model_path)

onnx_model = ORTModelForSequenceClassification.from_pretrained(onnx_model_path)
onnx_pipe = pipeline(task="text-classification", model=onnx_model, tokenizer=tokenizer)
onnx_pipe("How many rows are there in the table?")

```