Files
ebd5de00b4 [imagegpt/vilt/trocr] fix cache fixture tests: use hf_hub_download instead of load_dataset (#49178)
* [imagegpt/vilt/trocr] fix cache fixture tests: use hf_hub_download instead of load_dataset

On CI runners using the bucket cache, load_dataset returns a snapshot
path for image files without materializing the binary blob, causing
FileNotFoundError when tests try to open the cached images.

Replace load_dataset with hf_hub_download (which explicitly downloads
and guarantees the file exists) for:
- imagegpt: fixtures_image_utils (4-test-cats.jpg, 5-test-selena.jpeg)
- vilt: fixtures_nlvr2 (image1.jpeg, image2.jpeg)
- TrOCR: fixtures_ocr (iam_picture.jpeg, SROIE-receipt.jpeg)

Same fix as #49128 (gemma3n audio fixtures).

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

* ruff format fix for vilt test

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

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2026-09-29 10:45:08 +02:00
..
2022-05-03 14:42:02 +02:00