aal-hawa commited on
Commit
700ddf9
·
1 Parent(s): 7f53dc2
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -82,8 +82,9 @@ def ocr_process(image):
82
  # CRITICAL: The processor outputs bfloat16 tensors for pixel_values,
83
  # but the model is now float32. Convert ALL input tensors to float32.
84
  for key in inputs:
85
- if isinstance(inputs[key], torch.Tensor) and inputs[key().is_floating_point():
86
- inputs[key] = inputs[key].float()
 
87
 
88
  inputs = inputs.to("cpu")
89
 
 
82
  # CRITICAL: The processor outputs bfloat16 tensors for pixel_values,
83
  # but the model is now float32. Convert ALL input tensors to float32.
84
  for key in inputs:
85
+ if isinstance(inputs[key], torch.Tensor):
86
+ if inputs[key].is_floating_point():
87
+ inputs[key] = inputs[key].float()
88
 
89
  inputs = inputs.to("cpu")
90