Spaces:
Running
Running
Download challenge_adapter_example.py from kugguk/electrocheap: direct link, hf CLI and curl.
- Browser
- Download file 331 Bytes
-
https://huggingface.co/spaces/kugguk/electrocheap/resolve/main/challenge_adapter_example.py
- Command line
-
hf download hf://spaces/kugguk/electrocheap/challenge_adapter_example.py
-
curl -L -o challenge_adapter_example.py https://huggingface.co/spaces/kugguk/electrocheap/resolve/main/challenge_adapter_example.py
331 Bytes
| """Minimal trusted adapter example: replace predict with our model's inference.""" | |
| def predict(task, system_prompt): | |
| history = {r["timestamp"][:7]: r["value"] for r in task["history"]} | |
| return [{"id": t["id"], "forecast": history[f"{int(t['timestamp'][:4])-1}{t['timestamp'][4:7]}"]} | |
| for t in task["targets"]] | |