Spaces:
Paused
Paused
Commit History
-
Frontend simplification (4→2 tabs) + lazy imports for HF Spaces
Major changes: - Consolidate 4 tabs into 2: Input (room+images+observations) and Results+Chat - Add chat interface for Q&A and document modifications (pipeline/chat.py) - Lazy imports throughout to defer chromadb until needed - Auto-build RAG index on startup if empty - Default mock_models=False for production Files added: - ui/tabs/input_tab.py: Combined input tab with accordions - ui/tabs/results_tab.py: Results display with chat interface - pipeline/chat.py: Chat handler using vision model in text-only mode Import chain fixes (HF Spaces compatibility): - pipeline/__init__.py: __getattr__ lazy imports - rag/__init__.py: __getattr__ lazy imports - pipeline/main.py, dispositions.py, generator.py: TYPE_CHECKING + deferred imports - rag/retriever.py: Lazy vectorstore import in __init__ FDAM methodology fixes: - Public/Childcare lead threshold: 4.3 → 0.54 µg/100cm² (FDAM §1.4) - Sample density tiers for large areas (FDAM §2.3) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>78caafb -
Replace dual 8B with single 30B-A3B FP8 vision model
Simplify pipeline architecture: - Vision: Qwen3-VL-30B-A3B-Thinking-FP8 (~30-35GB) replaces dual 8B - Embedding: 2B model (2048-dim) replaces 8B - Reranker: 2B model replaces 8B - Total VRAM: ~38-43GB (was ~68GB), 45GB+ headroom on 4xL4 Key changes: - vLLM with FP8 quantization (built-in, no autoawq needed) - Proper Qwen3-VL chat template formatting via processor - Removed dual-model Thinking→Instruct pipeline - Single model handles analysis + structured JSON output Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>706520f -
Reduce thinking model max_new_tokens to fix slow inference
Root cause: max_new_tokens=32768 caused ~27 min inference time, appearing as a "hang". Reduced to 8192 for ~7 min thinking stage. The device mismatch warning is expected behavior - transformers handles routing internally for device_map="auto" models. Also includes ruff auto-fixes for unused imports. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>0699c5f -
Replace 30B MoE with dual 8B models (Thinking + Instruct)
Architecture change: - Vision: Qwen3-VL-30B-A3B-Instruct → dual Qwen3-VL-8B-Thinking + 8B-Instruct - Two-stage pipeline: Thinking (deep analysis) → Instruct (JSON formatting) - VRAM: 90GB → 68GB (~22GB savings, 20GB headroom on 4xL4) Key changes: - models/real.py: New DualVisionModel with token-based </think> parsing - config/settings.py: Dual model paths (vision_model_thinking, vision_model_instruct) - config/inference.py: ThinkingInferenceConfig (temp=0.6, max_tokens=32768) - Removed all lazy loading code (load_vision/unload_vision/load_rag) - All 4 models now load simultaneously at startup Per Qwen3-VL GitHub recommended hyperparameters for thinking models. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>333c083
-
Implement lazy model loading to prevent CUDA OOM on 4xL4 GPUs
Problem: All 3 models (~92GB) loaded at startup exceeded 88GB VRAM. Solution: Sequential loading - vision model during Stage 2, RAG models during Stage 3+. Vision is unloaded before RAG loads. Peak: ~60GB. Changes: - models/real.py: Add load_vision(), unload_vision(), load_rag() with proper hook removal per HuggingFace accelerate docs - models/loader.py: Real models now use lazy loading (no load_all) - pipeline/main.py: Load/unload at appropriate pipeline stages - rag/vectorstore.py: Use SharedEmbeddingFunction (no duplicate load) - rag/retriever.py: Use SharedReranker (no duplicate load) - models/mock.py: Add is_vision_loaded(), is_rag_loaded() for API parity Memory profile: - Phase A (Vision): 30B model ~60GB - Transition: Unload + gc + empty_cache - Phase B (RAG): 8B + 8B ~32GB - Peak never exceeds 60GB (fits in 88GB) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>5f0db1e -
Fix multi-GPU compatibility issues (6 locations)
1. Meta tensor error in reranker (BLOCKING): - Use .clone() to force weight materialization before copying - Create Linear layer with correct device/dtype from lm_head 2. Remove all .to(device) calls that break distributed models: - scripts/qwen3_vl/qwen3_vl_embedding.py:388 - scripts/qwen3_vl/qwen3_vl_reranker.py:109, 374 - models/real.py:259 - rag/vectorstore.py:130 - rag/retriever.py:149 With device_map="auto", transformers handles device routing internally. Manual .to(device) calls cause device mismatches on multi-GPU setups. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>d1901ae -
Fix critical model implementations and add sample scenarios
Model Fixes (verified against official Qwen3-VL-Embedding repo): - Embedding: Use last-token pooling instead of mean pooling - Embedding: Fix dimension from 768/384 to 4096 - Reranker: Use yes/no LM head weights + sigmoid instead of CLS norm - Apply fixes in both models/real.py and rag/vectorstore.py Additional Changes: - Add sample scenarios with real fire damage images - Add E2E tests with Playwright - Fix Gradio 6.x tab navigation tests - Add logging configuration - Improve UI form handling All 179 unit tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>f3ebc82 -
Initial commit: FDAM AI Pipeline v4.0.1
- Gradio-based fire damage assessment application - Qwen3-VL vision model integration (mock + real) - RAG-based knowledge retrieval with ChromaDB - FDAM-compliant calculations (ACH, sample density) - PDF generation with WeasyPrint - Session persistence via localStorage - 151 passing tests Ready for HuggingFace Spaces deployment on 4xL4 (96GB VRAM) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>88bdcff