Views
No views yet
1# transformers==4.29.1
2
3from transformers import AutoTokenizer, pipeline
4from optimum.onnxruntime import ORTModelForSequenceClassification
5
6onnx_model_path = "kevinng77/unsup_bert_L3"
7tokenizer = AutoTokenizer.from_pretrained(onnx_model_path)
8
9onnx_model = ORTModelForSequenceClassification.from_pretrained(onnx_model_path)
10onnx_pipe = pipeline(task="text-classification", model=onnx_model, tokenizer=tokenizer)
11onnx_pipe("How many rows are there in the table?")
12