Download app/api/benchmark.py from Emeritus-21/Hand-written-text-recognition-testing: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/spaces/Emeritus-21/Hand-written-text-recognition-testing/resolve/main/app/api/benchmark.py
- Command line
-
hf download hf://spaces/Emeritus-21/Hand-written-text-recognition-testing/app/api/benchmark.py
-
curl -L -o benchmark.py https://huggingface.co/spaces/Emeritus-21/Hand-written-text-recognition-testing/resolve/main/app/api/benchmark.py
396 Bytes
| import json | |
| from pathlib import Path | |
| from fastapi import APIRouter | |
| router=APIRouter(prefix="/benchmark",tags=["benchmark"]) | |
| DATA=Path(__file__).resolve().parents[2]/"benchmark"/"results.json" | |
| def results(): | |
| if not DATA.exists(): return {"results":[]} | |
| try: return {"results":json.loads(DATA.read_text(encoding="utf-8"))} | |
| except Exception: return {"results":[]} | |