Sumedh satish gajbhiye
Update handler.py
dd96d2c verified
from transformers import AutoTokenizer, pipeline
from optimum.onnxruntime import ORTModelForSequenceClassification
def init():
global classifier
model_id = "."
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = ORTModelForSequenceClassification.from_pretrained(model_id)
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
def __call__(data):
return classifier(data["inputs"])