SyFox / examples /smoke.py
Mr-DS-ML-85's picture
Upload folder using huggingface_hub
c97bd71 verified
Raw History Blame Contribute Delete
888 Bytes
#!/usr/bin/env python3
"""Minimal Space-side inference example (also used as a smoke test).
python3 examples/smoke.py # inside the repo root
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from inference import SyFox # noqa: E402
PROBES = [
"I was charged twice on my last invoice, please refund.",
"Congratulations! You won a £1000 prize. Call 09058094518 now!",
"The quarterback threw five touchdowns in the season opener.",
"আমার কার্ড থেকে দুইবার টাকা কেটেছে, ফেরত চাই।",
]
if __name__ == "__main__":
m = SyFox()
for s in PROBES:
r = m.decide(s)
a = r["answers"]["domain"]
print(f"[{r['script']:9s}] {a.get('choice'):5s} "
f"conf={a.get('confidence', 0):.3f} {s[:55]}")