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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

davidlightmysterion
Copy link

@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
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.

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.

2 participants