fix(hf_job): download dataset from Hub and point to clean source repo
Browse files- scripts/hf_train_job.py now downloads synthetic_dataset_v2.jsonl from
mattbitzesty/pino-synthetic-dataset when not present locally.
- hf_job.yaml clones the dedicated source repo pino-source-code.
- hf_job.yaml +1 -1
- scripts/hf_train_job.py +18 -3
hf_job.yaml
CHANGED
|
@@ -9,7 +9,7 @@ cmd:
|
|
| 9 |
- |
|
| 10 |
set -e
|
| 11 |
echo "Cloning pino source repository..."
|
| 12 |
-
git clone https://user:${HF_TOKEN}@huggingface.co/mattbitzesty/pino-source /workspace/pino
|
| 13 |
cd /workspace/pino
|
| 14 |
pip install -e . --no-deps
|
| 15 |
pip install torch --index-url https://download.pytorch.org/whl/cu121
|
|
|
|
| 9 |
- |
|
| 10 |
set -e
|
| 11 |
echo "Cloning pino source repository..."
|
| 12 |
+
git clone https://user:${HF_TOKEN}@huggingface.co/mattbitzesty/pino-source-code /workspace/pino
|
| 13 |
cd /workspace/pino
|
| 14 |
pip install -e . --no-deps
|
| 15 |
pip install torch --index-url https://download.pytorch.org/whl/cu121
|
scripts/hf_train_job.py
CHANGED
|
@@ -19,10 +19,25 @@ from pino.train import main as train_main
|
|
| 19 |
|
| 20 |
def hf_train_5epoch() -> None:
|
| 21 |
"""Run a controlled 5-epoch training pass and push artifacts to the Hub."""
|
| 22 |
-
|
| 23 |
-
# the cloned dataset path and enable GPU if available in the container.
|
| 24 |
data_path = REPO_ROOT / "data" / "synthetic_dataset_v2.jsonl"
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
# Allow the dataset to be mounted elsewhere in the container.
|
| 27 |
data_path = Path("/data/synthetic_dataset_v2.jsonl")
|
| 28 |
|
|
|
|
| 19 |
|
| 20 |
def hf_train_5epoch() -> None:
|
| 21 |
"""Run a controlled 5-epoch training pass and push artifacts to the Hub."""
|
| 22 |
+
token = os.environ.get("HF_TOKEN")
|
|
|
|
| 23 |
data_path = REPO_ROOT / "data" / "synthetic_dataset_v2.jsonl"
|
| 24 |
+
|
| 25 |
+
if not data_path.exists() and token:
|
| 26 |
+
# Download the dataset from the canonical dataset repository.
|
| 27 |
+
from huggingface_hub import hf_hub_download
|
| 28 |
+
|
| 29 |
+
print("📥 Downloading dataset from Hugging Face Hub...")
|
| 30 |
+
data_path.parent.mkdir(parents=True, exist_ok=True)
|
| 31 |
+
downloaded = hf_hub_download(
|
| 32 |
+
repo_id="mattbitzesty/pino-synthetic-dataset",
|
| 33 |
+
filename="synthetic_dataset_v2.jsonl",
|
| 34 |
+
repo_type="dataset",
|
| 35 |
+
token=token,
|
| 36 |
+
local_dir=str(data_path.parent),
|
| 37 |
+
)
|
| 38 |
+
data_path = Path(downloaded)
|
| 39 |
+
print(f" Dataset downloaded to {data_path}")
|
| 40 |
+
elif not data_path.exists():
|
| 41 |
# Allow the dataset to be mounted elsewhere in the container.
|
| 42 |
data_path = Path("/data/synthetic_dataset_v2.jsonl")
|
| 43 |
|