Views
No views yet
INT8 optimum.onnxruntime for accelerated pip install optimum[onnxruntime] transformers1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import AutoTokenizer, pipeline
3
4repo_id = "botirk/tiny-prompt-task-complexity-classifier"
5model = ORTModelForSequenceClassification.from_pretrained(repo_id)
6tokenizer = AutoTokenizer.from_pretrained(repo_id)
7
8# Note: The pipeline task is a simplification.
9# For full multi-headed output, you need to process the logits manually.
10classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
11
12prompt = "Write a mystery set in a small town where an everyday object goes missing."
13results = classifier(prompt)
14print(results)