Spaces:
Paused
Paused
Download src/config.py from ahmedsharaf/ClothSeg: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/ahmedsharaf/ClothSeg/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/ahmedsharaf/ClothSeg/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/ahmedsharaf/ClothSeg/resolve/main/src/config.py
363 Bytes
| import yaml | |
| from pathlib import Path | |
| CONFIG_PATH = Path(__file__).resolve().parent.parent / "config.yaml" | |
| def load_config() -> dict: | |
| """Load configuration from YAML file""" | |
| with open(CONFIG_PATH, 'r') as f: | |
| return yaml.safe_load(f) | |
| # Test | |
| if __name__ == "__main__": | |
| config = load_config() | |
| print(config) | |
| print(type(config)) |