fix the last ones

This commit is contained in:
Quentin Lhoest 2025-06-24 16:51:19 +02:00
parent 52f2dbe9ef
commit d48c569504
3 changed files with 4 additions and 4 deletions

View File

@ -171,7 +171,7 @@ class LayoutLMv3ProcessorIntegrationTests(unittest.TestCase):
from datasets import load_dataset
ds = load_dataset("hf-internal-testing/fixtures_docvqa", split="test")
return ds[0]["image"], ds[1]["image"]
return ds[0]["image"].convert("RGB"), ds[1]["image"].convert("RGB")
@cached_property
def get_tokenizers(self):

View File

@ -188,7 +188,7 @@ class UdopProcessorTest(ProcessorTesterMixin, unittest.TestCase):
processor = UdopProcessor.from_pretrained("microsoft/udop-large", apply_ocr=False)
def preprocess_data(examples):
images = [Image.open(path).convert("RGB") for path in examples["image_path"]]
images = [image.convert("RGB") for image in examples["image"]]
words = examples["words"]
boxes = examples["bboxes"]
word_labels = examples["ner_tags"]

View File

@ -1149,7 +1149,7 @@ class TrOCRModelIntegrationTest(unittest.TestCase):
def test_inference_handwritten(self):
model = VisionEncoderDecoderModel.from_pretrained("microsoft/trocr-base-handwritten").to(torch_device)
dataset = load_dataset("hf-internal-testing/fixtures_ocr", split="test")
dataset = load_dataset("hf-internal-testing/fixtures_ocr", split="train")
image = dataset[0]["image"].convert("RGB")
processor = self.default_processor
@ -1174,7 +1174,7 @@ class TrOCRModelIntegrationTest(unittest.TestCase):
def test_inference_printed(self):
model = VisionEncoderDecoderModel.from_pretrained("microsoft/trocr-base-printed").to(torch_device)
dataset = load_dataset("hf-internal-testing/fixtures_ocr", split="test")
dataset = load_dataset("hf-internal-testing/fixtures_ocr", split="train")
image = dataset[0]["image"].convert("RGB")
processor = self.default_processor