Skip to content

[Android] Support LLaVA and Phi-V #3195

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

Merged
merged 4 commits into from
May 1, 2025
Merged

Conversation

davidlightmysterion
Copy link
Contributor

@davidlightmysterion davidlightmysterion commented Apr 6, 2025

This PR introduces the support of LLaVA and Phi-V on android device.

Not thoroughly tested, but it works on my device. (Android 14.0)

checkpoints:

Screenshot_20250331_114427

@Mawriyo
Copy link

Mawriyo commented Apr 16, 2025

This is awesome work. @davidlightmysterion Can I recommend instead of hardcoding the image size using

std::vector<int64_t> new_shape = {1, 336, 336, 3};

Try something like this?

std::vector<int64_t> new_shape = {1, image_size, image_size, 3};

Looking at gemma 3 vision llm's they use different input image sizes. (896 x 896)

That way you no longer are limited to just these models for future use.

Remember this a recommendation and this is also just my first glance. I am going to dig deeper to see if this is actually what you would want to do or maybe you have a reason to hardcode.

Open to dialog for others in the community!

@davidlightmysterion
Copy link
Contributor Author

This is awesome work. @davidlightmysterion Can I recommend instead of hardcoding the image size using

std::vector<int64_t> new_shape = {1, 336, 336, 3};

Try something like this?

std::vector<int64_t> new_shape = {1, image_size, image_size, 3};

Looking at gemma 3 vision llm's they use different input image sizes. (896 x 896)

That way you no longer are limited to just these models for future use.

Remember this a recommendation and this is also just my first glance. I am going to dig deeper to see if this is actually what you would want to do or maybe you have a reason to hardcode.

Open to dialog for others in the community!

Sure, thanks for the advice. I'll fix it later.

Copy link
Member

@MasterJH5574 MasterJH5574 left a comment

Choose a reason for hiding this comment

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

@MasterJH5574 MasterJH5574 merged commit d2118b3 into mlc-ai:main May 1, 2025
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