samwell Claude commited on
Commit
18ae80c
·
1 Parent(s): e7caa1e

Re-enable NV-Reason-CXR for L40S GPU (48GB VRAM)

Browse files

With L40S, we now have enough VRAM for all 7 tools:
- NV-Reason-CXR: ~7GB (with 4-bit quantization)
- MAIRA-2 Grounding: ~22GB
- CheXagent VQA: ~2-3GB
- Classification + Report Gen: ~2GB
- Total: ~33-34GB out of 48GB (14GB free)

This completes the full MedRAX2 medical AI assistant with:
1. NV-Reason-CXR - Clinical reasoning
2. MAIRA-2 Grounding - Visual phrase grounding
3. CheXagent VQA - Interactive Q&A
4. Classification - Pathology detection
5. Report Generation - Radiology reports
6. DICOM Processor - File handling
7. Web Browsing - Medical information

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -35,19 +35,18 @@ tools = []
35
  if device == "cuda":
36
  # Load GPU-based tools
37
 
38
- # NV-Reason-CXR - Temporarily disabled (uses ~7GB VRAM)
39
- # Taking up too much memory alongside MAIRA-2 (15GB), leaving no room for VQA
40
- # Priority: VQA is more useful for interactive Q&A
41
- # try:
42
- # from medrax.tools import NVReasonCXRTool
43
- # nv_reason_tool = NVReasonCXRTool(
44
- # device=device,
45
- # load_in_4bit=True # Use quantization to save VRAM
46
- # )
47
- # tools.append(nv_reason_tool)
48
- # print("✓ Loaded NV-Reason-CXR tool")
49
- # except Exception as e:
50
- # print(f"✗ Failed to load NV-Reason-CXR tool: {e}")
51
 
52
  # MAIRA-2 Grounding - Re-enabled for L40S (48GB VRAM)
53
  try:
 
35
  if device == "cuda":
36
  # Load GPU-based tools
37
 
38
+ # NV-Reason-CXR - Re-enabled for L40S (48GB VRAM)
39
+ # With 48GB, we have room for all tools: MAIRA-2 (22GB) + VQA (2GB) + NV-Reason (7GB)
40
+ try:
41
+ from medrax.tools import NVReasonCXRTool
42
+ nv_reason_tool = NVReasonCXRTool(
43
+ device=device,
44
+ load_in_4bit=True # Use quantization to save VRAM (~7GB)
45
+ )
46
+ tools.append(nv_reason_tool)
47
+ print("✓ Loaded NV-Reason-CXR tool")
48
+ except Exception as e:
49
+ print(f"✗ Failed to load NV-Reason-CXR tool: {e}")
 
50
 
51
  # MAIRA-2 Grounding - Re-enabled for L40S (48GB VRAM)
52
  try: