Download scripts/test_model.py from jonin925/homelab: direct link, hf CLI and curl.
- Browser
- Download file 758 Bytes
-
https://huggingface.co/spaces/jonin925/homelab/resolve/main/scripts/test_model.py
- Command line
-
hf download hf://spaces/jonin925/homelab/scripts/test_model.py
-
curl -L -o test_model.py https://huggingface.co/spaces/jonin925/homelab/resolve/main/scripts/test_model.py
758 Bytes
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import os | |
| import sys | |
| import requests | |
| API_BASE_URL = os.getenv("API_BASE_URL", "http://localhost:7860") | |
| def main() -> int: | |
| print(f"Seeding test data via {API_BASE_URL}...") | |
| seed = requests.post(f"{API_BASE_URL}/ingest/test", timeout=60) | |
| seed.raise_for_status() | |
| print("Seed response:", seed.json()) | |
| summary = requests.get( | |
| f"{API_BASE_URL}/telemetry/summary", | |
| params={"session_key": 9159}, | |
| timeout=30, | |
| ) | |
| if summary.status_code == 404: | |
| print("No telemetry found yet. Try seeding again.") | |
| return 1 | |
| summary.raise_for_status() | |
| print("Summary:", summary.json()) | |
| return 0 | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |