inference-test-suite / run_tests.py
3morixd's picture
Upload run_tests.py with huggingface_hub
36b5c70 verified
Raw
History Blame Contribute Delete
503 Bytes
import json
from dispatchai import load_model
suite = json.load(open('test_suite.json'))['tests']
models = ['SmolLM2-135M-Instruct-mobile', 'Qwen2.5-0.5B-Instruct-mobile-int4']
for model_name in models:
model = load_model(model_name, backend='gguf')
for test in suite:
resp = model.chat(test['prompt'], max_tokens=50)
correct = test.get('expected_contains', '').lower() in resp.lower()
print(f'{"✅" if correct else "❌"} {model_name}: {test["id"]} = "{resp[:60]}"')