Download src/config.py from HarryDataScience/sentinel-fraud-detection: direct link, hf CLI and curl.
- Browser
- Download file 438 Bytes
-
https://huggingface.co/spaces/HarryDataScience/sentinel-fraud-detection/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/HarryDataScience/sentinel-fraud-detection/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/HarryDataScience/sentinel-fraud-detection/resolve/main/src/config.py
438 Bytes
| import hashlib | |
| from pathlib import Path | |
| import yaml | |
| ROOT = Path(__file__).resolve().parent.parent | |
| def load_config(path): | |
| with open(path, "r", encoding="utf-8") as fh: | |
| return yaml.safe_load(fh) | |
| def sha256_file(path, chunk=1 << 20) -> str: | |
| digest = hashlib.sha256() | |
| with open(path, "rb") as fh: | |
| for block in iter(lambda: fh.read(chunk), b""): | |
| digest.update(block) | |
| return digest.hexdigest() | |