BHARGAV REDDY commited on
Upload setup_and_train_300m.sh with huggingface_hub
Browse files- setup_and_train_300m.sh +21 -0
setup_and_train_300m.sh
CHANGED
|
@@ -63,6 +63,27 @@ else
|
|
| 63 |
exit 1
|
| 64 |
fi
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
# ββ 3. System probe ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 67 |
echo ""
|
| 68 |
echo "[3/5] System probe..."
|
|
|
|
| 63 |
exit 1
|
| 64 |
fi
|
| 65 |
|
| 66 |
+
python -c "
|
| 67 |
+
from pathlib import Path
|
| 68 |
+
import json
|
| 69 |
+
data_dir = Path('$DATA_DIR')
|
| 70 |
+
index_path = data_dir / 'index.json'
|
| 71 |
+
if not index_path.exists():
|
| 72 |
+
candidates = sorted(data_dir.glob('**/index.json'))
|
| 73 |
+
if candidates:
|
| 74 |
+
print('ERROR: index.json still not at dataset root after fetch.')
|
| 75 |
+
print('Found candidates:')
|
| 76 |
+
for candidate in candidates[:10]:
|
| 77 |
+
print(f' - {candidate}')
|
| 78 |
+
else:
|
| 79 |
+
print(f'ERROR: No index.json found under {data_dir}')
|
| 80 |
+
raise SystemExit(1)
|
| 81 |
+
with open(index_path, encoding='utf-8') as f:
|
| 82 |
+
idx = json.load(f)
|
| 83 |
+
total = sum(c.get('dim', 0) for c in idx.get('chunks', []))
|
| 84 |
+
print(f' Dataset ready: {len(idx.get("chunks", []))} chunks, {total:,} tokens at {index_path}')
|
| 85 |
+
"
|
| 86 |
+
|
| 87 |
# ββ 3. System probe ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 88 |
echo ""
|
| 89 |
echo "[3/5] System probe..."
|