Pivot / serving /typed_decisions.py
Q1z's picture
Expand Pivot model card, benchmarks, CPU tools and charts
7c85c7e verified
Raw History Blame Contribute Delete
733 Bytes
"""One context, three typed questions using Pivot's bundled runtime."""
import torch
from transformers import AutoModel, AutoTokenizer
repo = "Q1z/Pivot"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True, dtype=torch.float32).eval()
response = model.decide(
tokenizer,
"Customer dispute: invoice 120 vs PO 100, age=3d, region=US",
[
{"id": "route", "primitive": "choice",
"options": ["billing", "tech", "sales"]},
{"id": "approve", "primitive": "noul",
"options": ["true", "false"]},
{"id": "severity", "primitive": "score",
"options": ["0", "1", "2", "3"]},
],
)
print(response)