@@ -63,31 +63,39 @@ Now both the LLaMA part and the image encoder is in the `llava-v1.5-7b` director
63
63
``` console
64
64
git clone https://huggingface.co/liuhaotian/llava-v1.6-vicuna-7b
65
65
```
66
- 2 ) Use ` llava-surgery-v2.py ` which also supports llava-1.5 variants pytorch as well as safetensor models:
66
+
67
+ 2 ) Install the required Python packages:
68
+
69
+ ``` sh
70
+ pip install -r examples/llava/requirements.txt
71
+ ```
72
+
73
+ 3 ) Use ` llava-surgery-v2.py ` which also supports llava-1.5 variants pytorch as well as safetensor models:
67
74
``` console
68
75
python examples/llava/llava-surgery-v2.py -C -m ../llava-v1.6-vicuna-7b/
69
76
```
70
77
- you will find a llava.projector and a llava.clip file in your model directory
71
- 3 ) Copy the llava.clip file into a subdirectory (like vit), rename it to pytorch_model.bin and add a fitting vit configuration to the directory:
78
+
79
+ 4 ) Copy the llava.clip file into a subdirectory (like vit), rename it to pytorch_model.bin and add a fitting vit configuration to the directory:
72
80
``` console
73
81
mkdir vit
74
82
cp ../llava-v1.6-vicuna-7b/llava.clip vit/pytorch_model.bin
75
83
cp ../llava-v1.6-vicuna-7b/llava.projector vit/
76
84
curl -s -q https://huggingface.co/cmp-nct/llava-1.6-gguf/raw/main/config_vit.json -o vit/config.json
77
85
```
78
86
79
- 4 ) Create the visual gguf model:
87
+ 5 ) Create the visual gguf model:
80
88
``` console
81
89
python ./examples/llava/convert-image-encoder-to-gguf.py -m vit --llava-projector vit/llava.projector --output-dir vit --clip-model-is-vision
82
90
```
83
91
- This is similar to llava-1.5, the difference is that we tell the encoder that we are working with the pure vision model part of CLIP
84
92
85
- 5 ) Then convert the model to gguf format:
93
+ 6 ) Then convert the model to gguf format:
86
94
``` console
87
95
python ./convert.py ../llava-v1.6-vicuna-7b/ --skip-unknown
88
96
```
89
97
90
- 6 ) And finally we can run the llava-cli using the 1.6 model version:
98
+ 7 ) And finally we can run the llava-cli using the 1.6 model version:
91
99
``` console
92
100
./llava-cli -m ../llava-v1.6-vicuna-7b/ggml-model-f16.gguf --mmproj vit/mmproj-model-f16.gguf --image some-image.jpg -c 4096
93
101
```
0 commit comments