Spaces:
Sleeping
Sleeping
Download app/config.py from CallAuto/breakdown-risk-demo: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/CallAuto/breakdown-risk-demo/resolve/main/app/config.py
- Command line
-
hf download hf://spaces/CallAuto/breakdown-risk-demo/app/config.py
-
curl -L -o config.py https://huggingface.co/spaces/CallAuto/breakdown-risk-demo/resolve/main/app/config.py
643 Bytes
| import os | |
| from datetime import UTC, datetime | |
| from zoneinfo import ZoneInfo | |
| ORG = "bee2link" | |
| MODEL_SEARCH = "breakdown-risk-" | |
| DATASET_REPO = "bee2link/breakdown-risk" | |
| CALLER_TURNS = 3 | |
| REFRESH_SECONDS = 30 | |
| TOKEN = os.environ.get("HF_TOKEN") | |
| PARIS = ZoneInfo("Europe/Paris") | |
| LABEL_NAMES = {"risk": "Breakdown risk", "no_risk": "No risk"} | |
| def display(label: str) -> str: | |
| return LABEL_NAMES.get(label, label) | |
| def stamp(when: datetime) -> str: | |
| """One timestamp format everywhere, in Paris time; the Hub reports UTC.""" | |
| utc = when if when.tzinfo else when.replace(tzinfo=UTC) | |
| return f"{utc.astimezone(PARIS):%Y-%m-%d %H:%M %Z}" | |