[Bugfix] Fix phi3v batch inference when images have different aspect ratio (#7392)

This commit is contained in:
Isotr0py
2024-08-11 00:19:33 +08:00
committed by GitHub
parent baa240252e
commit 4c5d8e8ea9
4 changed files with 24 additions and 18 deletions

View File

@@ -81,7 +81,10 @@ def run_test(
inputs_per_image = [(
[prompt for _ in size_factors],
[rescale_image_size(image, factor) for factor in size_factors],
[
rescale_image_size(image, factor, transpose=idx)
for idx, factor in enumerate(size_factors)
],
) for image, prompt in zip(images, HF_IMAGE_PROMPTS)]
# NOTE: take care of the order. run vLLM first, and then run HF.