Skip to content

Commit 2c32f23

Browse files
test_vlm_pipeline:test_vlm_pipeline_match_optimum_preresized: remove unused conversation logic
1 parent 7eea3a2 commit 2c32f23

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

tests/python_tests/test_vlm_pipeline.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,50 +1556,22 @@ def get_nanollava_processor():
15561556

15571557
resized_image = None
15581558
resized_video = None
1559-
conversation = [
1560-
{
1561-
"role": "user",
1562-
"content": [
1563-
{"type": "text"},
1564-
],
1565-
}
1566-
]
1567-
1559+
15681560
prompt_parts = []
1569-
media_content = []
15701561
if has_image:
15711562
resized_image = request.getfixturevalue(f"cat_image_{resolution}x{resolution}")
1572-
media_content.append({"type": "image"})
15731563
prompt_parts.append("image")
15741564

15751565
if has_video:
15761566
resized_video = request.getfixturevalue("synthetic_video_32x32")
1577-
media_content.append({"type": "video"})
15781567
prompt_parts.append("video")
1579-
1580-
# For QWen-VL series models, in GenAI VLM implementation, video is placed before image in chat template,
1581-
# but in Optimum, this order depends only on the image and video order in the "conversation".
1582-
# So just reverse here in order to keep align.
1583-
if (
1584-
has_image
1585-
and has_video
1586-
and model_id
1587-
in [
1588-
"optimum-intel-internal-testing/tiny-random-qwen2.5-vl",
1589-
"optimum-intel-internal-testing/tiny-random-qwen2vl",
1590-
]
1591-
):
1592-
media_content.reverse()
1593-
conversation[0]["content"] = media_content + conversation[0]["content"]
1594-
1568+
15951569
if len(prompt_parts) == 1:
15961570
prompt = f"Describe this {prompt_parts[0]}."
15971571
elif len(prompt_parts) == 2:
15981572
prompt = f"Describe this {prompt_parts[0]} and {prompt_parts[1]}."
15991573
else:
16001574
prompt = "Describe."
1601-
1602-
conversation[0]["content"][-1]["text"] = prompt
16031575

16041576
model_path = _get_ov_model(model_id)
16051577

0 commit comments

Comments
 (0)