Commit Graph

2 Commits (7c4e935bde56ff126b772f174b6556f04f9a3be6)

Author SHA1 Message Date
MiniMind-V User 62f47fb844 [fix] LoRA/RAG: correct target modules, vlm_checkpoint call, and gitignore
- lora_utils.py: fix target_modules to match MiniMind arch (q/k/v/o_proj
  instead of GPT-2 style c_attn/c_proj/c_fc)
- train_sft_vlm_lora.py: fix broken vlm_checkpoint call in train_epoch
  (was passing model/epoch/step/args instead of vlm_config); now saves
  inline like train_sft_vlm.py; remove unused SkipBatchSampler import
- .gitignore: add __pycache__, .claude/, dataset/sft_vlm.parquet
2026-03-06 04:49:40 +00:00
MiniMind-V User a86648ed66 [feat] Implement LoRA + RAG for DriveMind-V
Implemented Day 1 of DriveMind-V plan: parameter-efficient training with LoRA and retrieval-augmented generation with FAISS.

## LoRA (Low-Rank Adaptation)
- Created trainer/lora_utils.py with LoRA configuration helpers
- Created trainer/train_sft_vlm_lora.py for LoRA-enabled SFT training
- Reduces trainable parameters by 98-99% (r=16 → ~1% trainable)
- Memory savings: ~50% during training
- Checkpoint size: 2-5MB vs 100-400MB for full model

## RAG (Retrieval-Augmented Generation)
- Created rag/ package with vector search infrastructure
- rag/vector_store.py: FAISS-based vector storage
- rag/retriever.py: CLIP ViT-B/16 based image retrieval
- rag/rag_vlm.py: RAG-enhanced VLM wrapper
- scripts/build_knowledge_base.py: Build FAISS index from images
- scripts/demo_rag.py: Interactive retrieval demo

## Demo & Testing
- Built demo knowledge base from 8 eval images
- Tested retrieval: perfect match at distance 0.0
- Fixed tensor shape bug in batch encoding

## Stats
- Time: ~1.5 hours
- Files created: 11 new files
- Dependencies added: faiss-cpu==1.13.2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-05 01:13:59 +00:00