Download hearthnet/controller.py from build-small-hackathon/HearthNet: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/HearthNet/resolve/main/hearthnet/controller.py
- Command line
-
hf download hf://spaces/build-small-hackathon/HearthNet/hearthnet/controller.py
-
curl -L -o controller.py https://huggingface.co/spaces/build-small-hackathon/HearthNet/resolve/main/hearthnet/controller.py
450 Bytes
| from __future__ import annotations | |
| from typing import Any | |
| from hearthnet.node import HearthNode | |
| class HearthNetController: | |
| def __init__(self, node: HearthNode) -> None: | |
| self.node = node | |
| def snapshot(self) -> dict[str, Any]: | |
| return self.node.snapshot() | |
| def apply_emergency_probe(self, results: dict[str, bool]) -> dict[str, Any]: | |
| self.node.detector.apply_probe_results(results) | |
| return self.snapshot() | |