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

🌋 Add support for LLaVA-Next in DPOTrainer #2413

Merged
merged 5 commits into from
Nov 29, 2024

Conversation

chenweize1998
Copy link
Contributor

What does this PR do?

This PR provides a quick fix for issue #2403. Previously, DPOTrainer did not support LLaVA-Next because the required image_sizes parameter from the LLaVA-Next forward function was being removed during data processing within DPOTrainer. This update modifies DPOTrainer to retain the image_sizes parameter if it is returned by the image processor and passes it to the model when present.

While this fix resolves the issue on my end - I successfully ran DPOTrainer with LLaVA-Next - but it has not been extensively tested. I would appreciate assistance or guidance on the next steps to ensure broader compatibility and robustness.

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? 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.
  • Did you write any new necessary tests?

Who can review?

Maybe @qgallouedec

@chenweize1998 chenweize1998 changed the title add support for llava-next in dpotrainer add support for LLaVA-Next in DPOTrainer Nov 29, 2024
@qgallouedec
Copy link
Member

Great! Thanks @chenweize1998! Can you try to uncomment

# ("trl-internal-testing/tiny-LlavaNextForConditionalGeneration",),

1rubbishyuan and others added 2 commits November 29, 2024 20:46
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@qgallouedec qgallouedec changed the title add support for LLaVA-Next in DPOTrainer 🌋 Add support for LLaVA-Next in DPOTrainer Nov 29, 2024
Copy link
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

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

Thanks @chenweize1998!

@qgallouedec
Copy link
Member

As expected, "Tests / Tests with dev dependencies" will fail until huggingface/transformers#34953 is merged. We can safely ignore this failing test.

@qgallouedec qgallouedec merged commit 8d9cfaa into huggingface:main Nov 29, 2024
12 of 13 checks 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.

4 participants