File size: 850 Bytes
2292bb2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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