git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build -DGGML_METAL=OFF # Added option to avoid errors
cmake --build build --config Release
Download the Qwen2-VL-2B-Instruct checkpoints from Hugging Face or ModelScope.
Refer to the transformation provided by @bartowski1182 or create them yourself.
python convert_hf_to_gguf.py ./Qwen2-VL-2B-Instruct --outfile ./qwen2-vl-2b-instruct-q8_0.gguf --outtype q8_0
python examples/llava/qwen2_vl_surgery.py ~/Desktop/code/Qwen2-VL-2B-Instruct
./build/bin/llama-qwen2vl-cli -m ./qwen2-vl-2b-instruct-q8_0.gguf --mmproj qwen2-vl-2b-instruct-vision.gguf -p 'Describe the image' --image ~/Desktop/logo.png
"The image depicts a stylized, abstract design that resembles a hexagonal shape with a blue and white gradient. The hexagon has a star-like appearance, with a series of triangles connecting its sides, creating a sense of symmetry and balance. The design has a modern and futuristic feel, with clean lines and a monochromatic color palette. The gradient effect adds a dynamic element, making the design look three-dimensional and slightly warped, as if it's floating in space."
This guide provides a clear and concise steps to set up and run Qwen2-VL through llama.cpp on a Mac M3. Enjoy exploring the capabilities of the model! 😄