llama-cpp-scripts / bin /llava-describe.sh
iandennismiller's picture
llava image describe
2292bb2
raw
history blame
850 Bytes
#!/bin/bash
SIZE=7b
LLAVA_PROMPT=$(
cat <<EOF
Generate a JSON description of the image by adapting the following JSON template:
{
extended_description: ""
number_of_people: ,
objects_in_picture_list: [
""
]
}
EOF
)
if [ "$SIZE" == "7b" ]; then
GGML_MODEL=~/.ai/models/llava/mys/ggml_llava-v1.5-7b/ggml-model-f16.gguf
MMPROJ_MODEL=~/.ai/models/llava/mys/ggml_llava-v1.5-7b/mmproj-model-f16.gguf
else
GGML_MODEL=~/.ai/models/llava/mys/ggml_llava-v1.5-13b/ggml-model-q4_k.gguf
MMPROJ_MODEL=~/.ai/models/llava/mys/ggml_llava-v1.5-13b/mmproj-model-f16.gguf
fi
llava \
--prompt-cache "$HOME/.ai/cache/llava.cache" \
--model "$GGML_MODEL" \
--mmproj "$MMPROJ_MODEL" \
--image "$1" \
--prompt "$LLAVA_PROMPT" \
--n-gpu-layers 1 \
--log-disable 2>/dev/null | grep -v clip_model_load