Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions samples/python/visual_language_chat/milebench_eval_vlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,16 @@ def __getitem__(self, idx):
context += choice_str

img_num = len(ann["task_instance"]["images_path"])
qwen2_vl_image_placeholder = "<|vision_start|><|image_pad|><|vision_end|>"

def idx_to_ov_image_placeholder(idx: int) -> str:
return f"<ov_genai_image_{idx}>"
Comment on lines +157 to +158
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The function name idx_to_ov_image_placeholder is verbose. Consider renaming it to format_image_placeholder or get_image_placeholder for better readability.

Copilot uses AI. Check for mistakes.

for i in range(img_num):
rmv_txt = "{image#%d}" % (i + 1)
rmv_tbl = "{table#%d}" % (i + 1)
context = context.replace(rmv_txt, qwen2_vl_image_placeholder)
context = context.replace(rmv_tbl, qwen2_vl_image_placeholder)
image_placeholder = idx_to_ov_image_placeholder(i)
context = context.replace(rmv_txt, image_placeholder)
context = context.replace(rmv_tbl, image_placeholder)

task_instruction_id = ann["task_instruction_id"]
context_str = task_instructions[task_instruction_id] + "\n" + context
Expand Down
4 changes: 3 additions & 1 deletion src/cpp/src/continuous_batching/pipeline_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ ContinuousBatchingPipeline::IContinuousBatchingPipeline::generate(
const std::vector<std::vector<ov::Tensor>>& images_vector,
const std::vector<GenerationConfig>& sampling_params,
const StreamerVariant& streamer) {
return generate(prompts, images_vector, {{}}, sampling_params, streamer);
// empty videos batch size should match prompt batch size
const std::vector<std::vector<ov::Tensor>> empty_videos_vector(prompts.size());
return generate(prompts, images_vector, empty_videos_vector, sampling_params, streamer);
}

std::vector<VLMDecodedResults>
Expand Down
Loading