Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Qwen2-VL generate with inputs_embeds #35466

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minostauros
Copy link

@minostauros minostauros commented Dec 31, 2024

What does this PR do?

Fixes #35463
However, not so sure about the fix is correct. At least test I added works, but failing some existing tests.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@zucchini-nlp

@minostauros
Copy link
Author

Failing test_contrastive_generate might be related to proper initialization of self.rope_deltas.
What do you think?

Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

@minostauros hey, thanks for submitting s PR!

Unfortunately, we'd like to keep the RoPE delta related code withing the forward method as it has been causing errors in some generation techniques. The failing tests are also related to the rope deltas, some techniques call model's forward several times with the same inputs and thus position ids might not be correct in such cases. Is there any way to fix this by changing only the forward code?

I suggest to refactor a bit the get_repo_index and remove the dependency on input_ids as a required argument when no video/image is passed

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.

Qwen2-VL used to work with inputs_embeds instead of input_ids, but no more
2 participants