Update HF Jobs training script
Browse files
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
|
| 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 |
-
|
|
|
|
| 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)
|