Spaces:
Runtime error
Runtime error
Download parse_requests.py from AIEnergyScore/launch-computation-example: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/spaces/AIEnergyScore/launch-computation-example/resolve/da355f5a322ecbfce4edb0c69844522cdfda0fbc/parse_requests.py
- Command line
-
hf download hf://spaces/AIEnergyScore/launch-computation-example@da355f5a322ecbfce4edb0c69844522cdfda0fbc/parse_requests.py
-
curl -L -o parse_requests.py https://huggingface.co/spaces/AIEnergyScore/launch-computation-example/resolve/da355f5a322ecbfce4edb0c69844522cdfda0fbc/parse_requests.py
466 Bytes
| from datasets import load_dataset | |
| requests_dataset = load_dataset('EnergyStarAI/requests_debug')['test'] | |
| def normalize_task(task): | |
| # Makes assumption about how the task names are being written, and called. | |
| return '_'.join(task.split()).lower() | |
| for request in requests_dataset: | |
| status = request['status'] | |
| if status == 'PENDING': | |
| model = request['model'] | |
| task = normalize_task(request['task']) | |
| print("%s,%s" % (model, task)) |