Download run_tests.py from dispatchAI/inference-test-suite: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/datasets/dispatchAI/inference-test-suite/resolve/main/run_tests.py
- Command line
-
hf download hf://datasets/dispatchAI/inference-test-suite/run_tests.py
-
curl -L -o run_tests.py https://huggingface.co/datasets/dispatchAI/inference-test-suite/resolve/main/run_tests.py
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]}"') | |