Download ml/utils/io.py from PRiyanshu0-1/TrackChain: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/PRiyanshu0-1/TrackChain/resolve/main/ml/utils/io.py
- Command line
-
hf download hf://PRiyanshu0-1/TrackChain/ml/utils/io.py
-
curl -L -o io.py https://huggingface.co/PRiyanshu0-1/TrackChain/resolve/main/ml/utils/io.py
433 Bytes
| # Artifact and config read/write helpers. | |
| import os | |
| from typing import Any, Dict | |
| import yaml | |
| def load_yaml(path: str) -> Dict[str, Any]: | |
| with open(path, "r", encoding="utf-8") as f: | |
| return yaml.safe_load(f) | |
| def save_yaml(data: Dict[str, Any], path: str): | |
| os.makedirs(os.path.dirname(path), exist_ok=True) | |
| with open(path, "w", encoding="utf-8") as f: | |
| yaml.safe_dump(data, f, default_flow_style=False) | |