Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ python -m pytorch_tokenizers.tools.llama2c.convert -t tokenizer.model -o tokeniz
### For LLaVA model
* For the Llava 1.5 model, you can get it from Huggingface [here](https://huggingface.co/llava-hf/llava-1.5-7b-hf).
* Run `examples/models/llava/install_requirements.sh` to install dependencies.
* Run the following command to generate llava.pte, tokenizer.bin and an image tensor (serialized in TorchScript) image.pt.
* Run the following command to generate llava.pte, tokenizer.bin and download an image basketball.jpg.

```
python -m executorch.examples.models.llava.export_llava --pte-name llava.pte --with-artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ python -m examples.models.llama.export_llama --checkpoint <path-to-your-checkpoi
### For LLaVA model
* For the Llava 1.5 model, you can get it from Huggingface [here](https://huggingface.co/llava-hf/llava-1.5-7b-hf).
* Run `examples/models/llava/install_requirements.sh` to install dependencies.
* Run the following command to generate llava.pte, tokenizer.bin and an image tensor (serialized in TorchScript) image.pt.
* Run the following command to generate llava.pte, tokenizer.bin and download an image basketball.jpg.

```
python -m executorch.examples.models.llava.export_llava --pte-name llava.pte --with-artifacts
Expand Down
13 changes: 3 additions & 10 deletions examples/models/llava/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ The model weights is 15GiB, and the other memory usage at export stage (`export_

### Generate ExecuTorch .PTE and other artifacts

Run the following command to generate `llava.pte`, `tokenizer.bin` and an image
tensor (serialized in TorchScript) `image.pt`.
Run the following command to generate `llava.pte`, `tokenizer.bin` and an image `basketball.jpg`.

> **Warning**: The C++ runner `llava_main` binary cannot process raw image inputs such as JPEG, PNG, or BMP files directly. You must convert these images to a `.pt` file format using the `examples/models/llava/image_util.py` script before using them with `llava_main`.

Prerequisite: run `install_executorch.sh` to install ExecuTorch and run
`examples/models/llava/install_requirements.sh` to install dependencies.
Expand All @@ -65,11 +63,6 @@ python -m executorch.examples.models.llava.test.test_pte llava.pte
See or run `.ci/scripts/test_llava.sh` shell script to build a C++ runner. This
script also has preliminary support to build the C++ runner for Android.

This also has an image utility Python script to generate image in PyTorch
loadable format. Alternatively, we are working on generating image format which
doesn't need PyTorch to load an image. Motivation for this is to build the C++
runner on Android.

Then you should be able to find `llava_main` binary:

```bash
Expand Down Expand Up @@ -104,8 +97,8 @@ Run:
cmake-out/examples/models/llava/llava_main \
--model_path=llava.pte \
--tokenizer_path=tokenizer.bin \
--image_path=image.pt \
--prompt="ASSISTANT:" \
--image_path=basketball.jpg \
--prompt="ASSISTANT:" \
--seq_len=768 \
--temperature=0
```
Expand Down
Loading