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 Bugs in chat UI #96

Merged
merged 4 commits into from
Nov 28, 2024
Merged

Fix Bugs in chat UI #96

merged 4 commits into from
Nov 28, 2024

Conversation

terhechte
Copy link
Contributor

The current version of the chat ui doesn't work because of wrong datatype assumptions. With these changes, running, e.g. Pixtral via python -m mlx_vlm.chat_ui --model mlx-community/pixtral-12b-4bit works again (on my system).

Llama vision still fails with a different error (ValueError: aspect_ratio_idsmust be provided ifpixel_values is provided) but Pixtral works.

@Blaizzy
Copy link
Owner

Blaizzy commented Oct 20, 2024

Thanks a lot @terhechte!

You can fix the llama-vision error by changing utils.py line 972 to:

kwargs = {
        k: v
        for k, v in zip(
            [
                "image_grid_thw",
                "image_sizes",
                "aspect_ratio_ids",
                "aspect_ratio_mask",
                "cross_attention_mask",
            ],
            inputs[3:],
        )
    }

@Blaizzy
Copy link
Owner

Blaizzy commented Oct 20, 2024

Could you run pre-commit run --all to fix the tests?

@terhechte
Copy link
Contributor Author

Done

@andimarafioti
Copy link
Contributor

This improved it for me. Still some other bugs but this worked

@Blaizzy
Copy link
Owner

Blaizzy commented Nov 28, 2024

Awesome!

Could you please open an issue for the other bugs?

@Blaizzy Blaizzy merged commit 14288ca into Blaizzy:main Nov 28, 2024
1 check 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.

3 participants