Scriptwriter dataset sync
Browse files- fix-and-train.sh +26 -11
- scriptwriter-runpod-ready.tgz +2 -2
fix-and-train.sh
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
-
# Fix
|
| 3 |
# curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/fix-and-train.sh" | bash
|
| 4 |
set -euo pipefail
|
| 5 |
|
|
@@ -7,32 +7,49 @@ echo "=== Killing old train session (if any) ==="
|
|
| 7 |
tmux kill-session -t scriptwriter-train 2>/dev/null || true
|
| 8 |
pkill -f 'train_runpod.py' 2>/dev/null || true
|
| 9 |
|
| 10 |
-
echo "===
|
| 11 |
python3 -m pip install -q --upgrade pip
|
| 12 |
-
|
| 13 |
python3 -m pip install -q --force-reinstall \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"transformers==4.46.3" \
|
| 15 |
"peft==0.13.2" \
|
| 16 |
"trl==0.12.1" \
|
| 17 |
"accelerate==0.34.2" \
|
| 18 |
"datasets>=2.19.0,<3.1" \
|
| 19 |
"huggingface_hub>=0.24.0,<0.30" \
|
| 20 |
-
"safetensors>=0.4.0"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
python3 - <<'PY'
|
| 23 |
-
import torch, transformers, peft, trl
|
| 24 |
print("torch", torch.__version__, "cuda", torch.cuda.is_available(), "gpus", torch.cuda.device_count())
|
|
|
|
| 25 |
print("transformers", transformers.__version__)
|
| 26 |
print("peft", peft.__version__)
|
| 27 |
print("trl", trl.__version__)
|
| 28 |
from peft import LoraConfig
|
| 29 |
-
from transformers import
|
| 30 |
print("imports ok")
|
| 31 |
PY
|
| 32 |
|
| 33 |
-
# Refresh trainer scripts from public bundle (has tmux install + pins)
|
| 34 |
DEST=/workspace/scriptwriter-runpod
|
| 35 |
TGZ=/tmp/scriptwriter-runpod-ready.tgz
|
|
|
|
| 36 |
curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/scriptwriter-runpod-ready.tgz" -o "$TGZ"
|
| 37 |
rm -rf "$DEST"
|
| 38 |
mkdir -p "$DEST"
|
|
@@ -44,15 +61,13 @@ export OUTPUT_DIR=/workspace/models/lora
|
|
| 44 |
export HF_DATASET_REPO="${HF_DATASET_REPO:-datamatters24/scriptwriter-corpus-ia}"
|
| 45 |
export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
|
| 46 |
export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
# Skip re-download noise: train.jsonl already present
|
| 49 |
if [[ ! -f /workspace/data/processed/train.jsonl ]]; then
|
| 50 |
echo "ERROR: /workspace/data/processed/train.jsonl missing"
|
| 51 |
exit 1
|
| 52 |
fi
|
| 53 |
|
| 54 |
cd "$DEST"
|
| 55 |
-
# Soft-patch: comment out dataset download section by setting SKIP flag the script understands
|
| 56 |
-
# If not present, just run — re-download is fine/fast from cache
|
| 57 |
-
export SKIP_DATASET_DOWNLOAD=1
|
| 58 |
bash scripts/runpod_train_tmux.sh
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
+
# Fix torch/transformers mismatch on RunPod pytorch images, then restart training.
|
| 3 |
# curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/fix-and-train.sh" | bash
|
| 4 |
set -euo pipefail
|
| 5 |
|
|
|
|
| 7 |
tmux kill-session -t scriptwriter-train 2>/dev/null || true
|
| 8 |
pkill -f 'train_runpod.py' 2>/dev/null || true
|
| 9 |
|
| 10 |
+
echo "=== Restoring torch 2.4.1 + matching torchvision (RunPod image stack) ==="
|
| 11 |
python3 -m pip install -q --upgrade pip
|
| 12 |
+
# Critical: do NOT let pip float torch to 2.13 — it breaks torchvision::nms on this image
|
| 13 |
python3 -m pip install -q --force-reinstall \
|
| 14 |
+
"torch==2.4.1" "torchvision==0.19.1" "torchaudio==2.4.1" \
|
| 15 |
+
--index-url https://download.pytorch.org/whl/cu124
|
| 16 |
+
|
| 17 |
+
echo "=== Installing pinned HF train stack (no torch upgrade) ==="
|
| 18 |
+
python3 -m pip uninstall -y transformers peft trl accelerate 2>/dev/null || true
|
| 19 |
+
python3 -m pip install -q \
|
| 20 |
"transformers==4.46.3" \
|
| 21 |
"peft==0.13.2" \
|
| 22 |
"trl==0.12.1" \
|
| 23 |
"accelerate==0.34.2" \
|
| 24 |
"datasets>=2.19.0,<3.1" \
|
| 25 |
"huggingface_hub>=0.24.0,<0.30" \
|
| 26 |
+
"safetensors>=0.4.0" \
|
| 27 |
+
"sentencepiece>=0.2.0" \
|
| 28 |
+
"protobuf>=4.25.0" \
|
| 29 |
+
"pyyaml>=6.0.0" \
|
| 30 |
+
"tqdm>=4.66.0" \
|
| 31 |
+
"bitsandbytes>=0.43.0,<0.46"
|
| 32 |
+
|
| 33 |
+
# Freeze torch again in case a dep tried to bump it
|
| 34 |
+
python3 -m pip install -q \
|
| 35 |
+
"torch==2.4.1" "torchvision==0.19.1" "torchaudio==2.4.1" \
|
| 36 |
+
--index-url https://download.pytorch.org/whl/cu124
|
| 37 |
|
| 38 |
python3 - <<'PY'
|
| 39 |
+
import torch, torchvision, transformers, peft, trl
|
| 40 |
print("torch", torch.__version__, "cuda", torch.cuda.is_available(), "gpus", torch.cuda.device_count())
|
| 41 |
+
print("torchvision", torchvision.__version__)
|
| 42 |
print("transformers", transformers.__version__)
|
| 43 |
print("peft", peft.__version__)
|
| 44 |
print("trl", trl.__version__)
|
| 45 |
from peft import LoraConfig
|
| 46 |
+
from transformers import AutoModelForCausalLM
|
| 47 |
print("imports ok")
|
| 48 |
PY
|
| 49 |
|
|
|
|
| 50 |
DEST=/workspace/scriptwriter-runpod
|
| 51 |
TGZ=/tmp/scriptwriter-runpod-ready.tgz
|
| 52 |
+
echo "=== Refreshing trainer scripts ==="
|
| 53 |
curl -fsSL "https://huggingface.co/datasets/datamatters24/scriptwriter-runpod/resolve/main/scriptwriter-runpod-ready.tgz" -o "$TGZ"
|
| 54 |
rm -rf "$DEST"
|
| 55 |
mkdir -p "$DEST"
|
|
|
|
| 61 |
export HF_DATASET_REPO="${HF_DATASET_REPO:-datamatters24/scriptwriter-corpus-ia}"
|
| 62 |
export HF_MODEL_REPO="${HF_MODEL_REPO:-datamatters24/scriptwriter-lora-ia}"
|
| 63 |
export BASE_MODEL="${BASE_MODEL:-meta-llama/Llama-3.2-3B-Instruct}"
|
| 64 |
+
# Prevent the trainer from force-reinstalling a newer torch
|
| 65 |
+
export RUNPOD_SKIP_FORCE_PIP=1
|
| 66 |
|
|
|
|
| 67 |
if [[ ! -f /workspace/data/processed/train.jsonl ]]; then
|
| 68 |
echo "ERROR: /workspace/data/processed/train.jsonl missing"
|
| 69 |
exit 1
|
| 70 |
fi
|
| 71 |
|
| 72 |
cd "$DEST"
|
|
|
|
|
|
|
|
|
|
| 73 |
bash scripts/runpod_train_tmux.sh
|
scriptwriter-runpod-ready.tgz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30dfccd6f6caee7fb287a7f5e9a3edab91ec1f87aa71a492b26e02b23da9b5c7
|
| 3 |
+
size 8178
|