Spaces:
Paused
Paused
Re-enable NV-Reason-CXR for L40S GPU (48GB VRAM)
Browse filesWith 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>
app.py
CHANGED
|
@@ -35,19 +35,18 @@ tools = []
|
|
| 35 |
if device == "cuda":
|
| 36 |
# Load GPU-based tools
|
| 37 |
|
| 38 |
-
# NV-Reason-CXR -
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 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:
|