feat(pino): literature seed integration, stratified dataset split, registry enrichment, and Space sync
31ee18f unverified Download scripts/generate_dataset.py from mattbitzesty/pino-source-code: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/mattbitzesty/pino-source-code/resolve/2d98eaab258c85a91a84dbb70e9e7a2045db91c8/scripts/generate_dataset.py
- Command line
-
hf download hf://mattbitzesty/pino-source-code@2d98eaab258c85a91a84dbb70e9e7a2045db91c8/scripts/generate_dataset.py
-
curl -L -o generate_dataset.py https://huggingface.co/mattbitzesty/pino-source-code/resolve/2d98eaab258c85a91a84dbb70e9e7a2045db91c8/scripts/generate_dataset.py
2.01 kB
| from __future__ import annotations | |
| """ | |
| Dataset generation wrapper for PINO. | |
| Runs the multi-threaded dataset builder and writes a synthetic formulation corpus | |
| (default 5,000 records) to data/synthetic_dataset_v2.jsonl. Intended for background | |
| execution via nohup. | |
| """ | |
| import argparse | |
| import logging | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).parent.parent / "src")) | |
| from pino.dataset_builder import DatasetBuilder, GENRES | |
| def main() -> int: | |
| parser = argparse.ArgumentParser(description="Generate PINO synthetic dataset v2") | |
| parser.add_argument("--output", default="data/synthetic_dataset_v2.jsonl", help="Output JSONL path") | |
| parser.add_argument("--rules", default="data/genre_rules.json", help="Genre rules JSON") | |
| parser.add_argument("--registry", default="src/pino/registry.db", help="SQLite registry path") | |
| parser.add_argument("--literature", default="data/literature_formulas.json", help="Literature blueprint JSON") | |
| parser.add_argument( | |
| "--total-records", | |
| type=int, | |
| default=5000, | |
| help="Total number of records across all genres", | |
| ) | |
| parser.add_argument("--workers", type=int, default=4, help="Thread workers") | |
| parser.add_argument("--seed", type=int, default=2026, help="Random seed") | |
| parser.add_argument("--log-level", default="INFO", help="Logging level") | |
| args = parser.parse_args() | |
| logging.basicConfig( | |
| level=getattr(logging, args.log_level.upper(), logging.INFO), | |
| format="%(asctime)s %(levelname)s %(name)s: %(message)s", | |
| ) | |
| per_genre = max(1, args.total_records // len(GENRES)) | |
| builder = DatasetBuilder( | |
| output_path=args.output, | |
| rules_path=args.rules, | |
| registry_path=args.registry, | |
| literature_path=args.literature, | |
| per_genre=per_genre, | |
| max_workers=args.workers, | |
| seed=args.seed, | |
| ) | |
| card = builder.build() | |
| print(card) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |