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 Llama-3.2-vision & Resize image #83

Merged
merged 17 commits into from
Oct 17, 2024
Merged

Conversation

Blaizzy
Copy link
Owner

@Blaizzy Blaizzy commented Oct 12, 2024

Adds support for Llama Vision, streamlined resize image and formated language model output.

  • Test multi-image
  • Add to trainer

Closes #60

@Blaizzy Blaizzy mentioned this pull request Oct 15, 2024
Copy link
Owner Author

@Blaizzy Blaizzy left a comment

Choose a reason for hiding this comment

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

LGTM!

@Blaizzy Blaizzy self-assigned this Oct 16, 2024
@Blaizzy Blaizzy added the enhancement New feature or request label Oct 16, 2024
@Blaizzy Blaizzy merged commit 9040235 into main Oct 17, 2024
1 check passed
@jrp2014
Copy link

jrp2014 commented Oct 19, 2024

Some other models work with the example python code, but this model seems to need another parameter:

meta-llama/Llama-3.2-11B-Vision
Fetching 15 files: 100%|█████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 36578.23it/s]
Fetching 15 files: 100%|█████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 15076.58it/s]
/Users/xxx/Pictures/Processed/20241012-153359_L1010053.jpg
Traceback (most recent call last):
  File "/Users/xxx/Documents/AI/mlx/scripts/vlm/mytest.py", line 33, in <module>
    formatted_prompt = apply_chat_template(
                       ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/mlx/lib/python3.12/site-packages/mlx_vlm/prompt_utils.py", line 140, in apply_chat_template
    return processor.apply_chat_template(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/mlx/lib/python3.12/site-packages/transformers/processing_utils.py", line 1067, in apply_chat_template
    raise ValueError(
ValueError: No chat template is set for this processor. Please either set the `chat_template` attribute, or provide a chat template as an argument. See https://huggingface.co/docs/transformers/main/en/chat_templating for more information.

@jrp2014
Copy link

jrp2014 commented Oct 19, 2024

But the -Instruct version of the model works! It's very much slower than some of the other models on a 48Gb M3 Max.

@Blaizzy Blaizzy deleted the pc/llama3.2-vision branch October 25, 2024 19:46
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.

LLaMA 3.2 11B Vision Support
2 participants