piyush-mk commited on
Commit
25e6791
·
verified ·
1 Parent(s): 9a88af0

Sync InvoiceGuard code for GRPO training job

Browse files
Files changed (1) hide show
  1. training/launch_hf_job.py +7 -2
training/launch_hf_job.py CHANGED
@@ -65,10 +65,15 @@ def upload_code(hf_username: str, code_repo_name: str) -> str:
65
  def submit_job(args: argparse.Namespace, code_repo_id: str) -> None:
66
  from huggingface_hub import run_uv_job
67
 
68
- script = TRAIN_SCRIPT.read_text(encoding="utf-8")
 
 
 
 
 
69
 
70
  job = run_uv_job(
71
- script=script,
72
  flavor=args.flavor,
73
  timeout=args.timeout,
74
  secrets={"HF_TOKEN": "$HF_TOKEN"},
 
65
  def submit_job(args: argparse.Namespace, code_repo_id: str) -> None:
66
  from huggingface_hub import run_uv_job
67
 
68
+ # `run_uv_job`'s Python API expects a local path or URL. Passing the script
69
+ # contents directly makes Jobs try to spawn a command whose "filename" is
70
+ # the entire source file. Use the script we just uploaded to the code repo.
71
+ script_url = (
72
+ f"https://huggingface.co/{code_repo_id}/resolve/main/training/train_grpo.py"
73
+ )
74
 
75
  job = run_uv_job(
76
+ script=script_url,
77
  flavor=args.flavor,
78
  timeout=args.timeout,
79
  secrets={"HF_TOKEN": "$HF_TOKEN"},