@@ -229,7 +229,7 @@ def test_image_processor_defaults_preserved_by_image_kwargs(self):
229
229
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
230
230
self .skip_processor_without_typed_kwargs (processor )
231
231
232
- input_str = "lower newer"
232
+ input_str = self . prepare_text_inputs ()
233
233
image_input = self .prepare_image_inputs ()
234
234
235
235
inputs = processor (text = input_str , images = image_input )
@@ -246,7 +246,7 @@ def test_kwargs_overrides_default_image_processor_kwargs(self):
246
246
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
247
247
self .skip_processor_without_typed_kwargs (processor )
248
248
249
- input_str = "lower newer"
249
+ input_str = self . prepare_text_inputs ()
250
250
image_input = self .prepare_image_inputs ()
251
251
252
252
inputs = processor (text = input_str , images = image_input , image_size = 224 )
@@ -263,7 +263,7 @@ def test_unstructured_kwargs(self):
263
263
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
264
264
self .skip_processor_without_typed_kwargs (processor )
265
265
266
- input_str = "lower newer"
266
+ input_str = self . prepare_text_inputs ()
267
267
image_input = self .prepare_image_inputs ()
268
268
inputs = processor (
269
269
text = input_str ,
@@ -288,8 +288,8 @@ def test_unstructured_kwargs_batched(self):
288
288
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
289
289
self .skip_processor_without_typed_kwargs (processor )
290
290
291
- input_str = [ "lower newer" , "upper older longer string" ]
292
- image_input = self .prepare_image_inputs () * 2
291
+ input_str = self . prepare_text_inputs ( batch_size = 2 )
292
+ image_input = self .prepare_image_inputs (batch_size = 2 )
293
293
inputs = processor (
294
294
text = input_str ,
295
295
images = image_input ,
@@ -313,7 +313,7 @@ def test_structured_kwargs_nested(self):
313
313
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
314
314
self .skip_processor_without_typed_kwargs (processor )
315
315
316
- input_str = "lower newer"
316
+ input_str = self . prepare_text_inputs ()
317
317
image_input = self .prepare_image_inputs ()
318
318
319
319
# Define the kwargs for each modality
@@ -339,7 +339,7 @@ def test_structured_kwargs_nested_from_dict(self):
339
339
340
340
processor = self .processor_class (tokenizer = tokenizer , image_processor = image_processor )
341
341
self .skip_processor_without_typed_kwargs (processor )
342
- input_str = "lower newer"
342
+ input_str = self . prepare_text_inputs ()
343
343
image_input = self .prepare_image_inputs ()
344
344
345
345
# Define the kwargs for each modality
0 commit comments