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

[Llava] Add csv image loading in C++ runner #5380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

digantdesai
Copy link
Contributor

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

Copy link

pytorch-bot bot commented Sep 15, 2024

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 6c1b6b2 with merge base 444480b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 15, 2024
@digantdesai digantdesai force-pushed the llava_csv_image branch 2 times, most recently from 6b66a90 to 0944ca3 Compare September 15, 2024 06:20
@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@swolchok
Copy link
Contributor

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)?

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
@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants