Download utils/io.py from royguw/vsg_eval: direct link, hf CLI and curl.
- Browser
- Download file 292 Bytes
-
https://huggingface.co/datasets/royguw/vsg_eval/resolve/main/utils/io.py
- Command line
-
hf download hf://datasets/royguw/vsg_eval/utils/io.py
-
curl -L -o io.py https://huggingface.co/datasets/royguw/vsg_eval/resolve/main/utils/io.py
292 Bytes
| import os | |
| import json | |
| def load_json(path): | |
| with open(path, 'r') as f: | |
| return json.load(f) | |
| def save_json(obj, path): | |
| with open(path, 'w') as f: | |
| json.dump(obj, f, indent=2) | |
| def list_json_files(folder): | |
| return [f for f in os.listdir(folder) if f.endswith('.json')] |