File size: 772 Bytes
f33c6dc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/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)
|