memoryai commited on
Commit
88eee8e
·
verified ·
1 Parent(s): 3f6f388

v7: explicit Flux model download with progress, no pipe to prevent timeout kill

Browse files
Files changed (1) hide show
  1. job_ml.sh +9 -6
job_ml.sh CHANGED
@@ -268,29 +268,32 @@ if [ "$EMB_COUNT" -gt 0 ]; then
268
  log " Already computed ($EMB_COUNT)"
269
  else
270
  # Download Flux model first (separate step so we see if it fails)
271
- log " Downloading Flux model..."
272
  python3 -u << PYEOF
 
 
273
  from huggingface_hub import snapshot_download
 
274
  snapshot_download(
275
  repo_id="black-forest-labs/FLUX.1-schnell",
276
  cache_dir="$DATA0/models",
277
  )
278
- print(" Flux model cached")
279
  PYEOF
 
280
 
281
- log " Computing embeddings..."
282
  python3 -u "$PROJECT_DIR/scripts/training/precompute_embeddings.py" \
283
  --data-dir "$SHARD_DIR" \
284
  --output-dir "$EMB_DIR" \
285
  --batch-size 4 \
286
  --cache-dir "$DATA0/models" \
287
- --device cuda:0 2>&1 | tee "$DATA1/logs/precompute.log" | tail -30
288
 
289
  EMB_COUNT=$(find "$EMB_DIR" -name "shard-*.pt" 2>/dev/null | wc -l | tr -d '[:space:]')
290
  EMB_COUNT=${EMB_COUNT:-0}
291
  if [ "$EMB_COUNT" -eq 0 ]; then
292
- log " FATAL: No embeddings. Last 20 lines of log:"
293
- tail -20 "$DATA1/logs/precompute.log" 2>/dev/null || true
294
  exit 1
295
  fi
296
  fi
 
268
  log " Already computed ($EMB_COUNT)"
269
  else
270
  # Download Flux model first (separate step so we see if it fails)
271
+ log " Downloading Flux model (~33GB, may take 5-10 min)..."
272
  python3 -u << PYEOF
273
+ import os
274
+ os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "0"
275
  from huggingface_hub import snapshot_download
276
+
277
  snapshot_download(
278
  repo_id="black-forest-labs/FLUX.1-schnell",
279
  cache_dir="$DATA0/models",
280
  )
281
+ print(" Flux model cached OK")
282
  PYEOF
283
+ log " Flux model ready"
284
 
285
+ log " Computing embeddings (this takes a while, printing progress)..."
286
  python3 -u "$PROJECT_DIR/scripts/training/precompute_embeddings.py" \
287
  --data-dir "$SHARD_DIR" \
288
  --output-dir "$EMB_DIR" \
289
  --batch-size 4 \
290
  --cache-dir "$DATA0/models" \
291
+ --device cuda:0
292
 
293
  EMB_COUNT=$(find "$EMB_DIR" -name "shard-*.pt" 2>/dev/null | wc -l | tr -d '[:space:]')
294
  EMB_COUNT=${EMB_COUNT:-0}
295
  if [ "$EMB_COUNT" -eq 0 ]; then
296
+ log " FATAL: No embeddings produced"
 
297
  exit 1
298
  fi
299
  fi