Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/models/ovis2/test_modeling_ovis2.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def setUp(self):
self.processor = AutoProcessor.from_pretrained(
"thisisiron/Ovis2-2B-hf",
)
# left padding is required for batched generation when the samples have different lengths
self.processor.tokenizer.padding_side = "left"
Comment on lines +199 to +200

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my two cents: it is very weird that we keep seeing random failures due to padding side, not the first time 🤔

Could it be smth on tokenizer classes or are we sure that test never passed? Maybe we need some way to catch these random default value changes in test_tokenization or smth if it happens so often

url = "https://huggingface.co/datasets/hf-internal-testing/fixtures-coco/resolve/main/val2017/000000039769.jpg"
self.image = load_test_image(url)
self.prompt_image = ""
Expand Down Expand Up @@ -305,7 +307,7 @@ def test_small_model_integration_test_batch_different_resolutions(self):
output = model.generate(**inputs, max_new_tokens=20)

EXPECTED_DECODED_TEXT = [
'system\nYou are a helpful assistant.\nuser\n\nWhat do you see in this image?\nassistant\nAnswer: I see a brown dog standing on a wooden floor in what appears to be a kitchen.',
'system\nYou are a helpful assistant.\nuser\n\nWhat do you see in this image?\nassistant\nI see a brown dog standing on a wooden floor in what appears to be a kitchen. The dog',
'system\nYou are a helpful assistant.\nuser\n\nWhat do you see in this image?\nassistant\nI see two cats lying on a pink blanket. There are also two remote controls on the blanket.'
] # fmt: skip

Expand Down
Loading