Spaces:
Running on Zero
Running on Zero
Download openmodellab/reporting/benchmark_writer.py from ajaygovind/OpenModelLab: direct link, hf CLI and curl.
- Browser
- Download file 416 Bytes
-
https://huggingface.co/spaces/ajaygovind/OpenModelLab/resolve/main/openmodellab/reporting/benchmark_writer.py
- Command line
-
hf download hf://spaces/ajaygovind/OpenModelLab/openmodellab/reporting/benchmark_writer.py
-
curl -L -o benchmark_writer.py https://huggingface.co/spaces/ajaygovind/OpenModelLab/resolve/main/openmodellab/reporting/benchmark_writer.py
416 Bytes
| from pathlib import Path | |
| import json | |
| def save_benchmark(report: dict, model_name: str): | |
| """ | |
| Save benchmark report as benchmark.json. | |
| """ | |
| outdir = Path("outputs") / model_name.replace("/", "_") | |
| outdir.mkdir(parents=True, exist_ok=True) | |
| outfile = outdir / "benchmark.json" | |
| with open(outfile, "w", encoding="utf-8") as f: | |
| json.dump(report, f, indent=2) | |
| return str(outfile) | |