Spaces:
Runtime error
Runtime error
Download src/utils/config.py from mickey1976/cove-api: direct link, hf CLI and curl.
- Browser
- Download file 280 Bytes
-
https://huggingface.co/spaces/mickey1976/cove-api/resolve/main/src/utils/config.py
- Command line
-
hf download hf://spaces/mickey1976/cove-api/src/utils/config.py
-
curl -L -o config.py https://huggingface.co/spaces/mickey1976/cove-api/resolve/main/src/utils/config.py
280 Bytes
| from pathlib import Path | |
| import yaml | |
| def load_config(cfg_path: str | Path) -> dict: | |
| p = Path(cfg_path) | |
| if not p.exists(): | |
| raise FileNotFoundError(f"Config not found: {p}") | |
| with open(p, "r") as f: | |
| return yaml.safe_load(f) | |
| __all__ = ["load_config"] |