samwell Claude commited on
Commit
f1877c8
·
1 Parent(s): f372684

Fix NV-Reason-CXR quantization config error

Browse files

Explicitly disable quantization parameters to prevent 'dict' object
has no attribute 'to_dict' error from embedded model config.

Added explicit parameters:
- quantization_config=None
- load_in_4bit=False
- load_in_8bit=False

Model will run at bfloat16 precision (~6-7GB VRAM).

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

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

Files changed (1) hide show
  1. medrax/tools/nv_reason_cxr.py +4 -0
medrax/tools/nv_reason_cxr.py CHANGED
@@ -72,12 +72,16 @@ class NVReasonCXRTool(BaseTool):
72
 
73
  # Note: Skipping quantization due to dict.to_dict() error
74
  # Model will run at bfloat16 precision (~6GB memory)
 
75
  self.model = AutoModelForImageTextToText.from_pretrained(
76
  model_path,
77
  device_map=self.device,
78
  cache_dir=cache_dir,
79
  torch_dtype=torch.bfloat16,
80
  trust_remote_code=True,
 
 
 
81
  ).eval()
82
 
83
  self.processor = AutoProcessor.from_pretrained(
 
72
 
73
  # Note: Skipping quantization due to dict.to_dict() error
74
  # Model will run at bfloat16 precision (~6GB memory)
75
+ # Explicitly disable quantization to prevent embedded config issues
76
  self.model = AutoModelForImageTextToText.from_pretrained(
77
  model_path,
78
  device_map=self.device,
79
  cache_dir=cache_dir,
80
  torch_dtype=torch.bfloat16,
81
  trust_remote_code=True,
82
+ quantization_config=None, # Explicitly disable quantization
83
+ load_in_4bit=False, # Explicitly set to False
84
+ load_in_8bit=False, # Explicitly set to False
85
  ).eval()
86
 
87
  self.processor = AutoProcessor.from_pretrained(