From 3bb3ab5fdbcd93b3b0a8fcad7ba7277b0b1dbf13 Mon Sep 17 00:00:00 2001 From: "serge[bot]" Date: Wed, 14 Oct 2026 02:08:45 +0000 Subject: [PATCH 1/2] [serge] Fix 1 integration test for model `deepseek_vl_hybrid` failing with `output_mismatch` (list output differs (1)) --- .../test_modeling_deepseek_vl_hybrid.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py b/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py index a9e6f2a18097..fef31f131d6c 100644 --- a/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py +++ b/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py @@ -317,12 +317,18 @@ def test_model_text_generation_batched(self): ], ] EXPECTED_TEXT = [ - "You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.\n\nUser: Describe this image.\n\nAssistant:\nThe image depicts a fluffy, light brown animal with a white face and black markings around its eyes", # fmt: skip + "You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.\n\nUser: Describe this image.\n\nAssistant:The image depicts a fluffy, light brown animal with a white face and black markings on its face and", # fmt: skip "You are a helpful language and vision assistant. You are able to understand the visual content that the user provides, and assist the user with a variety of tasks using natural language.\n\nUser: What animal do you see in the image?\n\nAssistant:I see a large, furry animal that appears to be a type of bear.The ", # fmt: skip ] inputs = processor.apply_chat_template( - messages, add_generation_prompt=True, tokenize=True, padding=True, return_dict=True, return_tensors="pt" + messages, + add_generation_prompt=True, + tokenize=True, + padding=True, + return_dict=True, + return_tensors="pt", + padding_side="left", ) inputs = inputs.to(model.device, dtype=model.dtype) output = model.generate(**inputs, max_new_tokens=20, do_sample=False) From 0f68dd44ccad5e87cfb63f819a7cdf886d77e2c7 Mon Sep 17 00:00:00 2001 From: "serge[bot]" Date: Fri, 23 Oct 2026 23:34:54 +0000 Subject: [PATCH 2/2] [serge] Fix 2 integration tests for model `deepseek_vl_hybrid` failing with `OOM`, raising `OutOfMemoryError` (other (2) --- .../test_modeling_deepseek_vl_hybrid.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py b/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py index fef31f131d6c..1a6e4b633a68 100644 --- a/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py +++ b/tests/models/deepseek_vl_hybrid/test_modeling_deepseek_vl_hybrid.py @@ -33,6 +33,7 @@ from ...generation.test_utils import GenerationTesterMixin from ...test_configuration_common import ConfigTester +from ...test_memory_cleanup_mixin import MemoryCleanupMixin from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask from ...test_pipeline_mixin import PipelineTesterMixin from ...test_processing_common import url_to_local_path @@ -238,15 +239,13 @@ def test_sdpa_can_dispatch_on_flash(self): @require_torch @require_torch_accelerator @slow -class DeepseekVLHybridIntegrationTest(unittest.TestCase): +class DeepseekVLHybridIntegrationTest(MemoryCleanupMixin, unittest.TestCase): def setUp(self): + super().setUp() self.model_id = "deepseek-community/deepseek-vl-7b-chat" def test_model_text_generation(self): - model = DeepseekVLHybridForConditionalGeneration.from_pretrained( - self.model_id, dtype="auto", device_map="auto" - ) - model.to(torch_device) + model = DeepseekVLHybridForConditionalGeneration.from_pretrained(self.model_id, dtype="auto").to(torch_device) model.eval() processor = AutoProcessor.from_pretrained(self.model_id) @@ -279,10 +278,7 @@ def test_model_text_generation(self): ) def test_model_text_generation_batched(self): - model = DeepseekVLHybridForConditionalGeneration.from_pretrained( - self.model_id, dtype="auto", device_map="auto" - ) - model.to(torch_device) + model = DeepseekVLHybridForConditionalGeneration.from_pretrained(self.model_id, dtype="auto").to(torch_device) model.eval() processor = AutoProcessor.from_pretrained(self.model_id) @@ -337,10 +333,7 @@ def test_model_text_generation_batched(self): self.assertEqual(EXPECTED_TEXT, text) def test_model_text_generation_with_multi_image(self): - model = DeepseekVLHybridForConditionalGeneration.from_pretrained( - self.model_id, dtype="auto", device_map="auto" - ) - model.to(torch_device) + model = DeepseekVLHybridForConditionalGeneration.from_pretrained(self.model_id, dtype="auto").to(torch_device) model.eval() processor = AutoProcessor.from_pretrained(self.model_id)