Download examples/inference.py from imtk/OpenThai-SystemOne-ONNX: direct link, hf CLI and curl.
- Browser
- Download file 766 Bytes
-
https://huggingface.co/imtk/OpenThai-SystemOne-ONNX/resolve/main/examples/inference.py
- Command line
-
hf download hf://imtk/OpenThai-SystemOne-ONNX/examples/inference.py
-
curl -L -o inference.py https://huggingface.co/imtk/OpenThai-SystemOne-ONNX/resolve/main/examples/inference.py
766 Bytes
| from openthai_systemone_onnx import Choice, Noul, OnnxSystemOneClient, Score | |
| client = OnnxSystemOneClient("imtk/OpenThai-SystemOne-ONNX") | |
| response = client.system_one( | |
| "ร้านนี้บริการดีมาก แต่อาหารค่อนข้างช้า", | |
| { | |
| "sentiment": Choice( | |
| instructions="What is the overall sentiment?", | |
| criteria={"positive": None, "neutral": None, "negative": None}, | |
| ), | |
| "recommend": Noul(instructions="Would the writer recommend the restaurant?"), | |
| "quality": Score( | |
| instructions="Rate the service quality.", | |
| criteria=["poor", "acceptable", "good", "excellent"], | |
| ), | |
| }, | |
| ) | |
| print(response.model_dump_json(indent=2)) | |