Spaces:
Sleeping
Sleeping
Download modules/data_loader.py from marvit0/raaf-alpha: direct link, hf CLI and curl.
- Browser
- Download file 330 Bytes
-
https://huggingface.co/spaces/marvit0/raaf-alpha/resolve/main/modules/data_loader.py
- Command line
-
hf download hf://spaces/marvit0/raaf-alpha/modules/data_loader.py
-
curl -L -o data_loader.py https://huggingface.co/spaces/marvit0/raaf-alpha/resolve/main/modules/data_loader.py
330 Bytes
| import json | |
| import pkgutil | |
| from pathlib import Path | |
| def load_json(filename: str) -> dict: | |
| data_path = Path(__file__).parent / "data" / filename | |
| with open(data_path) as f: | |
| return json.load(f) | |
| # Once, at app startup: | |
| FEELINGS_WHEEL = load_json("feelings_wheel.json") | |
| NEEDS_WHEEL = load_json("needs_wheel.json") | |