-
Notifications
You must be signed in to change notification settings - Fork 428
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
[Llava] Add csv image loading in C++ runner #5380
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5380
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 6c1b6b2 with merge base 444480b (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
6b66a90
to
0944ca3
Compare
@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
CSV seems like an unfortunate choice of image format. Why not PNG (or any other image format -- load the image and then blast it into a Tensor)? |
0944ca3
to
0874123
Compare
Rationale - We don't want to depend on Torch when building for Android. This add two things, (1) for AoT, python image_util optionally generates a .csv from a jpg. In addition to .pt. (2) add a runtime runner flag which hints at the provided image is a csv. And if so, the runner parses the csv and feeds it to the model. This is very naive and obviously fragile. Added some checks in python. Tested few ways, - On M1, with torch, loaded both .pt and .csv generated from the same jpg. And the LLM produces same text. - On Android, without torch, loaded .csv and it also produces similar text.:wq
0874123
to
6c1b6b2
Compare
@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Rationale - We don't want to depend on Torch when building for Android.
This add two things,
(1) for AoT, python image_util optionally generates a .csv from a jpg. In addition to .pt.
(2) add a runtime runner flag which hints at the provided image is a csv. And if so, the runner parses the csv and feeds it to the model.
This is very naive and obviously fragile. Added some checks in python.
Tested few ways,