From f89561b6a8bdb838fa08b4540bbb1464742da87e Mon Sep 17 00:00:00 2001 From: Nucleic Date: Sun, 2 Aug 2026 16:31:06 -0700 Subject: [PATCH] Merge nucleic/fuzzy-dewy-urchin-hpvd into dev --- README.md | 4 ++++ rebuild_sol_high.py | 6 +++++- tests/test_rebuild_sol_high.py | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71bc5a5..be3cd80 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,10 @@ Print the two clean, from-pretrained-base training commands after promotion: "$PY" ml/purpose-classifier/rebuild_sol_high.py train-commands ``` +By default the generated commands use the Python interpreter that invoked +`rebuild_sol_high.py`, so running this from an activated virtual environment emits that +environment's concrete Python path. Pass `--python ` only to override it. + The purpose-lite command starts from the pinned MiniLM revision. The purpose-deep command starts from the pinned ModernBERT base variant; neither command supplies a prior classifier checkpoint or continuation flag. diff --git a/rebuild_sol_high.py b/rebuild_sol_high.py index 85c8ce1..497b6a0 100644 --- a/rebuild_sol_high.py +++ b/rebuild_sol_high.py @@ -666,7 +666,11 @@ def build_parser() -> argparse.ArgumentParser: commands_parser = subparsers.add_parser( "train-commands", help="print clean from-base training commands" ) - commands_parser.add_argument("--python", default="$PY") + commands_parser.add_argument( + "--python", + default=sys.executable, + help="Python interpreter to print in each command (default: this interpreter)", + ) return parser diff --git a/tests/test_rebuild_sol_high.py b/tests/test_rebuild_sol_high.py index 8a92c73..2eb7451 100644 --- a/tests/test_rebuild_sol_high.py +++ b/tests/test_rebuild_sol_high.py @@ -131,6 +131,16 @@ class RebuildSolHighTests(unittest.TestCase): self.assertNotIn("--resume-from", commands) self.assertNotIn("--model ", commands) + def test_training_commands_default_to_invoking_interpreter(self): + args = rebuild_sol_high.build_parser().parse_args(["train-commands"]) + + self.assertEqual(args.python, sys.executable) + self.assertTrue( + rebuild_sol_high.train_commands(args.python).startswith( + f'"{sys.executable}" ml/purpose-classifier/train.py' + ) + ) + def test_complete_stage_promotes_public_and_combined_datasets(self): with tempfile.TemporaryDirectory() as directory: root = Path(directory)