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

Loading model with transformers / converting weights to GGUF #869

Open
vladislavdonchev opened this issue Feb 27, 2025 · 1 comment
Open

Comments

@vladislavdonchev
Copy link

vladislavdonchev commented Feb 27, 2025

We're trying to add support for Qwen2.5 VL in llama.cpp.

Taking into account the new architecture, we are able to extract and convert the VLM, but it seems that there is some incompatibility with the previous version.

This is the current SAFETENSORS -> GGUF code:
https://github.com/Independent-AI-Labs/llama.cpp/blob/master/examples/llava/qwen2_5_vl_surgery.py

The extracted model just crashes llama.cpp, so I am investigating that, but it is entirely possible that the model conversion is not handled correctly as well.

Any hints or pointers would be greatly appreciated! Thanks!

@vladislavdonchev vladislavdonchev changed the title Converting weights to GGUF Loading model with transformers / converting weights to GGUF Feb 28, 2025
@vladislavdonchev
Copy link
Author

UDPATE: OK, so I've noticed a difference in the patch merger compared to Qwen2:


  (merger): PatchMerger(
    (ln_q): LayerNorm((1280,), eps=1e-06, elementwise_affine=True)
    (mlp): Sequential(
      (0): Linear(in_features=5120, out_features=5120, bias=True)
      (1): GELU(approximate='none')
      (2): Linear(in_features=5120, out_features=3584, bias=True)
    )
  )

Affine transform for the normalization layer should not be a problem, but the out features are now 2048 instead of 3584.
We probably have to account for that somewhere along the line.

Are my assumptions correct? Could someone please advise?

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

No branches or pull requests

1 participant