walidsobhie-code Claude Opus 4.6 commited on
Commit
fd566cb
·
1 Parent(s): a6de582

fix: skip model download to avoid crashes

Browse files

- Check if model exists FIRST before downloading
- Skip download entirely if model not found
- Add validation check before training

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. colab_train_stack29.ipynb +1 -1
colab_train_stack29.ipynb CHANGED
@@ -70,7 +70,7 @@
70
  "execution_count": null,
71
  "metadata": {},
72
  "outputs": [],
73
- "source": "# STEP 7: Train LoRA Adapter\nimport os # Make sure os is imported\nimport sys\nsys.path.insert(0, os.path.join(REPO_DIR, \"stack/training\"))"
74
  },
75
  {
76
  "cell_type": "code",
 
70
  "execution_count": null,
71
  "metadata": {},
72
  "outputs": [],
73
+ "source": "# STEP 7: Train LoRA Adapter\nimport os\nimport sys\n\n# Check if model exists before training\nif not os.path.exists(os.path.join(MODEL_DIR, \"config.json\")):\n print(\"❌ Model not found! Cannot train without base model.\")\n print(f\"Expected at: {MODEL_DIR}\")\n raise RuntimeError(\"Model missing - please upload base model to Drive first\")\n\nsys.path.insert(0, os.path.join(REPO_DIR, \"stack/training\"))\n\nprint(\"=\"*60)\nprint(\"STARTING TRAINING\")\nprint(\"=\"*60)\n\nfrom train_lora import train_lora\ntrainer = train_lora(updated_config_path)\n\nprint(\"=\"*60)\nprint(\"TRAINING COMPLETED\")\nprint(\"=\"*60)"
74
  },
75
  {
76
  "cell_type": "code",