John aa23412989 llava : support v1.6 (#5267) hace 1 año
..
android 3ce7e8f8e7 llava : MobileVLM support (#4954) hace 2 años
CMakeLists.txt ce18d727a4 clip : enable gpu backend (#4205) hace 2 años
MobileVLM-README.md 15606309a0 llava : add MobileVLM support (#5132) hace 1 año
README.md aa23412989 llava : support v1.6 (#5267) hace 1 año
clip.cpp aa23412989 llava : support v1.6 (#5267) hace 1 año
clip.h aa23412989 llava : support v1.6 (#5267) hace 1 año
convert-image-encoder-to-gguf.py aa23412989 llava : support v1.6 (#5267) hace 1 año
llava-cli.cpp aa23412989 llava : support v1.6 (#5267) hace 1 año
llava-surgery-v2.py aa23412989 llava : support v1.6 (#5267) hace 1 año
llava-surgery.py e00d2a62dd llava : add requirements.txt and update README.md (#5428) hace 1 año
llava.cpp aa23412989 llava : support v1.6 (#5267) hace 1 año
llava.h aa23412989 llava : support v1.6 (#5267) hace 1 año
requirements.txt e00d2a62dd llava : add requirements.txt and update README.md (#5428) hace 1 año

README.md

LLaVA

Currently this implementation supports llava-v1.5 variants.

The pre-converted 7b and 13b models are available.

After API is confirmed, more models will be supported / uploaded.

Usage

Build with cmake or run make llava-cli to build it.

After building, run: ./llava-cli to see the usage. For example:

./llava-cli -m ../llava-v1.5-7b/ggml-model-f16.gguf --mmproj ../llava-v1.5-7b/mmproj-model-f16.gguf --image path/to/an/image.jpg

note: A lower temperature like 0.1 is recommended for better quality. add --temp 0.1 to the command to do so.

LLaVA 1.5

  • Clone a LLaVA and a CLIP model (available options). For example:

    git clone https://huggingface.co/liuhaotian/llava-v1.5-7b
    
    git clone https://huggingface.co/openai/clip-vit-large-patch14-336
    
  1. Install the required Python packages:

    pip install -r examples/llava/requirements.txt
    
  2. Use llava-surgery.py to split the LLaVA model to LLaMA and multimodel projector constituents:

    python ./examples/llava/llava-surgery.py -m ../llava-v1.5-7b
    
  3. Use convert-image-encoder-to-gguf.py to convert the LLaVA image encoder to GGUF:

    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
    
  4. Use convert.py to convert the LLaMA part of LLaVA to GGUF:

    python ./convert.py ../llava-v1.5-7b
    

Now both the LLaMA part and the image encoder is in the llava-v1.5-7b directory.

LLaVA 1.6

  • Use llava-surgery-v2.py

  • TODO: add detailed instructions

TODO

  • Support non-CPU backend for the image encoding part.
  • Support different sampling methods.
  • Support more model variants.