Skip to content

Fix inference error in LlavaNextForConditionalGeneration with text-only input - #35554

Closed
CatcherInThePy wants to merge 3 commits into
huggingface:mainfrom
CatcherInThePy:patch-1
Closed

Fix inference error in LlavaNextForConditionalGeneration with text-only input#35554
CatcherInThePy wants to merge 3 commits into
huggingface:mainfrom
CatcherInThePy:patch-1

Conversation

@CatcherInThePy

Copy link
Copy Markdown

What does this PR do?

This simple fix addresses an issue where running inference with text-only input (a.k.a. without any image data ) causes an error on line 874, as image_features is None. The update restructures the checks for image_features and legacy_processing to properly handle cases where no image data is present, while preserving the integrity of the remaining processing steps. This is a suggested fix to the reported issue #35421

Fixes #35421

Before submitting

Who can review?

Vision models: @amyeroberts, @qubvel

…e data is provided

This fix addresses an issue where running inference without image data causes an error on line 874, as `image_features` is `None`. The update restructures the checks for `image_features` and `legacy_processing` to properly handle cases where no image data is present, while preserving the integrity of the remaining processing steps.
@qubvel

qubvel commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

cc @zucchini-nlp

@zucchini-nlp zucchini-nlp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey, thanks for the PR but we already have merged a fix for LLaVA models today #34502. Feel free to update to the latest main branch :)

@CatcherInThePy

Copy link
Copy Markdown
Author

Hello @zucchini-nlp,

That's fantastic news! Perfect timing as well ^-^ Thank you so much for the heads-up. I'm looking forward to more opportunities to contribute in the future. :) I am closing the PR.

Best.

@CatcherInThePy
CatcherInThePy deleted the patch-1 branch January 8, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Text Only input using LlaVa Next

3 participants