Skip to content

Commit

Permalink
nit change version deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yonigozlan committed Oct 17, 2024
1 parent 819e22c commit 7a4a0e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/transformers/pipelines/image_text_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,10 @@ def __call__(
)
else:
# Reorganize the images to match the prompts
images_reorganized = []
for num_images in num_images_in_text:
images_reorganized.append(images[:num_images])
images = images[num_images:]
images = images_reorganized
images = [
images[sum(num_images_in_text[:i]) : sum(num_images_in_text[: i + 1])]
for i in range(len(num_images_in_text))
]
else:
if hasattr(self.processor, "image_token") and self.processor.image_token is not None:
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/pipelines/image_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def preprocess(self, image, prompt=None, timeout=None):

if prompt is not None:
logger.warning_once(
"Passing `prompt` to the `image-to-text` pipeline is deprecated and will be removed in version 4.45"
"Passing `prompt` to the `image-to-text` pipeline is deprecated and will be removed in version 4.48"
" of 🤗 Transformers. Use the `image-text-to-text` pipeline instead",
)
if not isinstance(prompt, str):
Expand Down

0 comments on commit 7a4a0e4

Please sign in to comment.