Spaces:
Runtime error
Runtime error
Download OtherDS.py from leonwoo/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 450 Bytes
-
https://huggingface.co/spaces/leonwoo/Final_Assignment_Template/resolve/main/OtherDS.py
- Command line
-
hf download hf://spaces/leonwoo/Final_Assignment_Template/OtherDS.py
-
curl -L -o OtherDS.py https://huggingface.co/spaces/leonwoo/Final_Assignment_Template/resolve/main/OtherDS.py
450 Bytes
| from datasets import load_dataset | |
| ds = load_dataset("arterm-sedov/agent-course-final-assignment", "init") # default config | |
| rows = ds["train"][:200] # grab 200 rows (dict of lists) | |
| # Convert to a list of dicts (row-wise) for JSON export: | |
| rowwise = [dict(zip(rows.keys(), values)) for values in zip(*rows.values())] | |
| import json | |
| with open("rows.json", "w", encoding="utf-8") as f: | |
| json.dump(rowwise, f, ensure_ascii=False, indent=2) | |