| #!/usr/bin/env python3 | |
| """Download eval script parts from Hub, combine, and run.""" | |
| import os, subprocess | |
| from huggingface_hub import hf_hub_download | |
| REPO = "narcolepticchicken/agent-cost-optimizer" | |
| parts = ["eval/run_bert_eval_full.py", "eval/eval_bert_partB.py", "eval/eval_bert_partC.py", "eval/eval_bert_partD.py"] | |
| combined = "/app/eval_bert_combined.py" | |
| with open(combined, "w") as out: | |
| for part in parts: | |
| path = hf_hub_download(REPO, part) | |
| with open(path) as f: | |
| out.write(f.read()) | |
| out.write("\n\n") | |
| print(f"Combined script: {combined}") | |
| print(f"Size: {os.path.getsize(combined)} bytes") | |
| # Run it | |
| import subprocess, sys | |
| result = subprocess.run([sys.executable, combined], capture_output=False) | |
| sys.exit(result.returncode) | |