oneiros / scripts /smoke_model.py
Adinda Panca Mochamad
Day 1: foundation — ekstraksi JSON, Gradio minimal, trace logger
c10196a
Raw
History Blame Contribute Delete
547 Bytes
#!/usr/bin/env python3
"""Smoke test: load model dan generate satu token."""
import sys
sys.path.insert(0, ".")
from model.loader import MODEL_PATH, get_model
def main():
print(f"MODEL_PATH={MODEL_PATH}")
model = get_model()
out = model.create_chat_completion(
messages=[{"role": "user", "content": "Say OK in one word."}],
max_tokens=4,
temperature=0.0,
)
teks = out["choices"][0]["message"]["content"]
print(f"Response: {teks!r}")
print("Smoke OK")
if __name__ == "__main__":
main()