Skip to content

Commit e00d2a6

Browse files
authored
llava : add requirements.txt and update README.md (#5428)
* llava: add requirements.txt and update README.md This commit adds a `requirements.txt` file to the `examples/llava` directory. This file contains the required Python packages to run the scripts in the `examples/llava` directory. The motivation of this to make it easier for users to run the scripts in `examples/llava`. This will avoid users from having to possibly run into missing package issues if the packages are not installed on their system. Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com> * llava: fix typo in llava-surgery.py output Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com> --------- Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
1 parent 7c777fc commit e00d2a6

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

examples/llava/README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,25 @@ git clone https://huggingface.co/liuhaotian/llava-v1.5-7b
2929
git clone https://huggingface.co/openai/clip-vit-large-patch14-336
3030
```
3131

32-
2. Use `llava-surgery.py` to split the LLaVA model to LLaMA and multimodel projector constituents:
32+
2. Install the required Python packages:
33+
34+
```sh
35+
pip install -r examples/llava/requirements.txt
36+
```
37+
38+
3. Use `llava-surgery.py` to split the LLaVA model to LLaMA and multimodel projector constituents:
3339

3440
```sh
3541
python ./examples/llava/llava-surgery.py -m ../llava-v1.5-7b
3642
```
3743

38-
3. Use `convert-image-encoder-to-gguf.py` to convert the LLaVA image encoder to GGUF:
44+
4. Use `convert-image-encoder-to-gguf.py` to convert the LLaVA image encoder to GGUF:
3945

4046
```sh
4147
python ./examples/llava/convert-image-encoder-to-gguf.py -m ../clip-vit-large-patch14-336 --llava-projector ../llava-v1.5-7b/llava.projector --output-dir ../llava-v1.5-7b
4248
```
4349

44-
4. Use `convert.py` to convert the LLaMA part of LLaVA to GGUF:
50+
5. Use `convert.py` to convert the LLaMA part of LLaVA to GGUF:
4551

4652
```sh
4753
python ./convert.py ../llava-v1.5-7b

examples/llava/llava-surgery.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@
4242
torch.save(checkpoint, path)
4343

4444
print("Done!")
45-
print(f"Now you can convert {args.model} to a a regular LLaMA GGUF file.")
45+
print(f"Now you can convert {args.model} to a regular LLaMA GGUF file.")
4646
print(f"Also, use {args.model}/llava.projector to prepare a llava-encoder.gguf file.")

examples/llava/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-r ../../requirements/requirements-convert.txt
2+
pillow~=10.2.0
3+
torch~=2.1.1

0 commit comments

Comments
 (0)