transformers
07371dce - [Florence2] Fix two integration test failures caused by torch 2.13 and auto-dtype (#48031)

Commit
1 day ago
[Florence2] Fix two integration test failures caused by torch 2.13 and auto-dtype (#48031) * [Florence2] Update batching SDPA test expected values for torch 2.13 Torch 2.13 SDPA produces slightly different numerical results causing token 50446 → 50447 at two positions in OCR_WITH_REGION output, cascading to different bounding box coordinates and a different CAPTION text ("a green volkswagen beetle..." vs "a green car..."). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * [Florence2] Fix dtype mismatch in test_large_model_inference_eager `florence-community/Florence-2-large` weights are stored in float16. After PR #34919 made `torch_dtype="auto"` the default, processor outputs (float32) are passed to a float16 model, causing: RuntimeError: Input type (float) and bias type (c10::Half) should be the same Fix: cast `pixel_values` to `model.dtype` after moving inputs to device, matching what the model expects while keeping `input_ids` as int. Update expected prediction IDs and generated text accordingly. Regression first appeared in CI on Dec 12 2025. Verified passing on A10 runner (torch 2.13.0+cu130). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Author
Parents
Loading