datamatters24 commited on
Commit
9456045
·
verified ·
1 Parent(s): b663ba3

Scriptwriter dataset sync

Browse files
Files changed (2) hide show
  1. fix-and-train.sh +32 -0
  2. scriptwriter-runpod-ready.tgz +2 -2
fix-and-train.sh CHANGED
@@ -64,6 +64,38 @@ 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
 
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 "=== train.jsonl missing — downloading dataset ${HF_DATASET_REPO} ==="
69
+ mkdir -p /workspace/data/processed
70
+ python3 - <<'PY'
71
+ import os
72
+ from pathlib import Path
73
+ from huggingface_hub import snapshot_download, login
74
+ token = os.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN")
75
+ if not token:
76
+ raise SystemExit("HF_TOKEN not set in environment — set it in RunPod and retry")
77
+ login(token=token, add_to_git_credential=False)
78
+ dest = Path("/workspace/data/processed")
79
+ snapshot_download(
80
+ repo_id=os.environ.get("HF_DATASET_REPO", "datamatters24/scriptwriter-corpus-ia"),
81
+ repo_type="dataset",
82
+ local_dir=str(dest),
83
+ token=token,
84
+ )
85
+ train = dest / "train.jsonl"
86
+ if not train.exists():
87
+ for alt in ("train-ia.jsonl", "train-local.jsonl", "checkpoint-ia.jsonl"):
88
+ src = dest / alt
89
+ if src.exists() and src.stat().st_size > 0:
90
+ train.write_text(src.read_text(encoding="utf-8"), encoding="utf-8")
91
+ print(f"Created train.jsonl from {alt}")
92
+ break
93
+ if not train.exists():
94
+ raise SystemExit("Download finished but train.jsonl still missing")
95
+ print(f"train.jsonl lines: {sum(1 for _ in train.open() if _.strip())}")
96
+ PY
97
+ fi
98
+
99
  if [[ ! -f /workspace/data/processed/train.jsonl ]]; then
100
  echo "ERROR: /workspace/data/processed/train.jsonl missing"
101
  exit 1
scriptwriter-runpod-ready.tgz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:30dfccd6f6caee7fb287a7f5e9a3edab91ec1f87aa71a492b26e02b23da9b5c7
3
- size 8178
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ab582380f2f6dbbbab1202a5a554f431be7a1726f69b4043a3b16a60d772d32
3
+ size 8404