Dev-the-dev91 commited on
Commit
165dde9
·
verified ·
1 Parent(s): 2fdd1d4

Update HF Jobs training script

Browse files
Files changed (1) hide show
  1. scripts/hf_jobs_train_syllabus.py +4 -3
scripts/hf_jobs_train_syllabus.py CHANGED
@@ -44,8 +44,8 @@ def run(cmd: list[str], *, cwd: Path | None = None) -> None:
44
 
45
 
46
  def uv_run(script_args: list[str], *, cwd: Path) -> None:
47
- """Run a repo script with project deps (HF Jobs UV image has no pip module)."""
48
- run(["uv", "run", *script_args], cwd=cwd)
49
 
50
 
51
  def _require_hub_token() -> str:
@@ -71,7 +71,8 @@ def main() -> None:
71
  if WORK.exists():
72
  run(["rm", "-rf", str(WORK)])
73
  run(["git", "clone", "--depth", "1", PIPELINE_GIT, str(WORK)])
74
- run(["uv", "pip", "install", "-e", ".[train]"], cwd=WORK)
 
75
 
76
  data_dir = WORK / "data" / "finetune"
77
  data_dir.mkdir(parents=True, exist_ok=True)
 
44
 
45
 
46
  def uv_run(script_args: list[str], *, cwd: Path) -> None:
47
+ """Run a repo script using the synced project venv (--extra train)."""
48
+ run(["uv", "run", "--extra", "train", *script_args], cwd=cwd)
49
 
50
 
51
  def _require_hub_token() -> str:
 
71
  if WORK.exists():
72
  run(["rm", "-rf", str(WORK)])
73
  run(["git", "clone", "--depth", "1", PIPELINE_GIT, str(WORK)])
74
+ # Create .venv with train extras so `uv run --extra train` sees datasets/trl/torch.
75
+ run(["uv", "sync", "--extra", "train"], cwd=WORK)
76
 
77
  data_dir = WORK / "data" / "finetune"
78
  data_dir.mkdir(parents=True, exist_ok=True)