Spaces:
Sleeping
Sleeping
| """CLI bootstrap dataset validācijai.""" | |
| from __future__ import annotations | |
| import argparse | |
| import sys | |
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| if str(PROJECT_ROOT) not in sys.path: | |
| sys.path.insert(0, str(PROJECT_ROOT)) | |
| from maris_core.data.validator import ( # noqa: E402 | |
| DatasetValidationError, | |
| format_summary, | |
| validate_dataset_dir, | |
| ) | |
| def main() -> int: | |
| """Palaiž bootstrap dataset validāciju.""" | |
| parser = argparse.ArgumentParser(description="Validē Maris bootstrap dataset JSONL failus") | |
| parser.add_argument( | |
| "--profile", | |
| choices=("auto", "bootstrap", "eval"), | |
| default="auto", | |
| help="Validācijas profils: bootstrap, eval vai auto (pēc direktorijas nosaukuma).", | |
| ) | |
| parser.add_argument( | |
| "dataset_dir", | |
| nargs="?", | |
| default=PROJECT_ROOT.parent / "data", | |
| type=Path, | |
| help="Bootstrap dataset direktorija", | |
| ) | |
| args = parser.parse_args() | |
| try: | |
| summary = validate_dataset_dir(args.dataset_dir, profile=args.profile) | |
| except DatasetValidationError as exc: | |
| print(str(exc), file=sys.stderr) | |
| return 1 | |
| print(format_summary(summary)) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |