Download examples/quickstart.py from djinn-san/QSIV: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/djinn-san/QSIV/resolve/main/examples/quickstart.py
- Command line
-
hf download hf://djinn-san/QSIV/examples/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/djinn-san/QSIV/resolve/main/examples/quickstart.py
1.07 kB
| """QSIV quick start: calibrated typed decisions in one forward pass (run from the repository root).""" | |
| from qsiv.runtime.service import QSIVService | |
| svc = QSIVService("qsiv_fp8.safetensors", "calibration.json", tokenizer_dir="tokenizer") | |
| request = { | |
| "state": ("Refund policy: customers may return items within 30 days of delivery for a full refund. Items marked FINAL SALE " | |
| "cannot be returned.\nCase: order 5521 was delivered on March 2; the customer asked for a refund on March 20 for " | |
| "an unopened blender that was not marked FINAL SALE."), | |
| "questions": [ | |
| {"type": "noul", "text": "Is the customer entitled to a full refund?"}, | |
| {"type": "choice", "text": "Which rule decides this case?", "options": ["30-day window", "FINAL SALE exclusion", "none"]}, | |
| {"type": "score", "text": "How confident can an agent be in approving?", "levels": ["low", "medium", "high"]}, | |
| ], | |
| } | |
| for d in svc.decide(request): | |
| print({k: (round(v, 3) if isinstance(v, float) else v) for k, v in d.items() if k != "probs"}) | |