Download scripts/check.py from aizana1/Tuvan-VK-Corpus: direct link, hf CLI and curl.
- Browser
- Download file 741 Bytes
-
https://huggingface.co/datasets/aizana1/Tuvan-VK-Corpus/resolve/main/scripts/check.py
- Command line
-
hf download hf://datasets/aizana1/Tuvan-VK-Corpus/scripts/check.py
-
curl -L -o check.py https://huggingface.co/datasets/aizana1/Tuvan-VK-Corpus/resolve/main/scripts/check.py
741 Bytes
| #!/usr/bin/env python3 | |
| """Load every config through `datasets` exactly as the Hub will (README configs), | |
| check the schema and print a few rows. Run before uploading.""" | |
| from pathlib import Path | |
| from datasets import get_dataset_config_names, load_dataset | |
| ROOT = Path(__file__).resolve().parent.parent | |
| configs = get_dataset_config_names(str(ROOT)) | |
| print("configs:", configs) | |
| for name in configs: | |
| ds = load_dataset(str(ROOT), name, split="train") | |
| assert ds.num_rows > 0, name | |
| assert "text" in ds.column_names and "lang_heuristic" in ds.column_names, name | |
| print(f"\n== {name}: {ds.num_rows:,} rows") | |
| print(" ", ds.features) | |
| print(" ", ds[0]["text"][:100].replace("\n", " ")) | |
| print("\nAll configs load correctly.") | |