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

Basic pixtral support, paving the way for vision models 🖼️ #153

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

francoishernandez
Copy link
Member

@francoishernandez francoishernandez commented Nov 29, 2024

Conversion

Conversion is made to work with the mistral-community models, and was for now only tested with mistral-community/pixtral-12b.
The official mistralai models lack quite some information to be usable in our context. (HF checkpoints lack information as well, but it's more manageable.)

What works

The provided test_inference.py script in the pixtral recipe allows to run inference on a few examples (grabbed from the Pixtral blog post).
The configuration is using bitsandbytes quantization by default, to allow running on a 24G VRAM GPU (tested on 3090).
Some differences in a few methods (notably rope) lead to slight numerical differences with the HF implementation (as most of our models anyways).

What does not work (yet)

What needs to be improved

  • model definition (split out eole.models.model? allow for different adapter classes?)
  • configuration / documentation
  • proper configuration of specific image tokens
  • HF conversion script (not only related to this work)
  • dataloading is a bit hacky and might benefit some refactoring/simplification
  • support more Llava-like models?

@francoishernandez francoishernandez force-pushed the more_tokenizers branch 2 times, most recently from 11f0c4b to b13ac3f Compare November 29, 2024 15:23
@francoishernandez francoishernandez added the enhancement New feature or request label Dec 4, 2024
@francoishernandez francoishernandez changed the base branch from more_tokenizers to main January 12, 2025 14:51
@francoishernandez francoishernandez force-pushed the pixtral branch 2 times, most recently from 6a07c42 to 2212f16 Compare January 12, 2025 16:26
@francoishernandez
Copy link
Member Author

francoishernandez commented Jan 12, 2025

Recent changes (mostly #171) broke a few things here, I grabbed the changes and created a clean commit from there.

Also, "model-level rope" might not the best here because we have different kinds of rope for the vision encoder and the text decoder. So for now, the vision encoder rope is defined within the encoder code, while the "model-level rope" is the text decoder one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant