feat(pino): literature seed integration, stratified dataset split, registry enrichment, and Space sync
31ee18f unverified Download scripts/verify_benchmarks.py from mattbitzesty/pino-source-code: direct link, hf CLI and curl.
- Browser
- Download file 2.1 kB
-
https://huggingface.co/mattbitzesty/pino-source-code/resolve/e5ed910db3fc2e9023d818084e530294149c7abf/scripts/verify_benchmarks.py
- Command line
-
hf download hf://mattbitzesty/pino-source-code@e5ed910db3fc2e9023d818084e530294149c7abf/scripts/verify_benchmarks.py
-
curl -L -o verify_benchmarks.py https://huggingface.co/mattbitzesty/pino-source-code/resolve/e5ed910db3fc2e9023d818084e530294149c7abf/scripts/verify_benchmarks.py
2.1 kB
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| from typing import Any | |
| sys.path.insert(0, str(Path(__file__).parent.parent / "src")) | |
| from pino.inference import FragranceInferenceEngine | |
| def run_gold_standard_validation(model_path: str, blueprint_path: str) -> dict[str, Any]: | |
| """Run hidden literature holdouts through the trained PINO pipeline.""" | |
| engine = FragranceInferenceEngine(model_path=model_path) | |
| blueprint = json.loads(Path(blueprint_path).read_text()) | |
| holdouts = [f for f in blueprint if f.get("pipeline_role") == "holdout"] | |
| print("====== RUNNING HUMAN LITERATURE ALIGNMENT EXAM ======") | |
| results = [] | |
| for formula in holdouts: | |
| predictions = engine.run_full_pipeline(formula["components"]) | |
| top_predicted_notes = predictions.get("pyramid", {}).get("top", []) | |
| print(f"\nFormula: {formula['name']}") | |
| print(f"Expected: {formula.get('expected_profile', 'N/A')} | Predicted Top: {top_predicted_notes}") | |
| results.append({ | |
| "formula_id": formula["formula_id"], | |
| "name": formula["name"], | |
| "expected_profile": formula.get("expected_profile"), | |
| "predicted_top": top_predicted_notes, | |
| }) | |
| return {"holdouts_evaluated": len(results), "results": results} | |
| def main() -> int: | |
| parser = argparse.ArgumentParser(description="Validate trained PINO against literature holdouts") | |
| parser.add_argument("--model-path", default="./models/pino_cloud_weights", help="Path to trained model weights") | |
| parser.add_argument("--blueprint", default="data/literature_formulas.json", help="Literature blueprint JSON") | |
| parser.add_argument("--output", default="data/literature_validation_results.json", help="Output JSON path") | |
| args = parser.parse_args() | |
| summary = run_gold_standard_validation(args.model_path, args.blueprint) | |
| Path(args.output).write_text(json.dumps(summary, indent=2)) | |
| print(f"\nWrote validation results to {args.output}") | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |