not working with llama.cpp

#1
by fawogin598 - opened

When I run this model and upload an image, the llama.cpp throws:
In the UI: Error: "This model supports: text files, PDFs"
through the local API: "image input is not supported - hint: if this is unexpected, you may need to provide the mmproj"

{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "describe this image"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,/9j/4AAQ...
          }
        }
      ]
    }
  ],
  "model": "MiniCPM-V-4_6-F16",
  "mmproj":"mmproj-model-f16"
}

logs:

[51243] 0.01.938.469 I srv          init: init: chat template, thinking = 1
[51243] 0.01.938.493 I srv          main: model loaded
[51243] 0.01.938.495 I srv          main: server is listening on http://127.0.0.1:51243
[51243] cmd_child_to_router:ready
[51243] cmd_child_to_router:info:{"id":"MiniCPM-V-4_6-Q4_K_M","aliases":["MiniCPM-V-4_6-Q4_K_M"],"tags":[],"object":"model","created":1786180099,"owned_by":"llamacpp","meta":{"vocab_type":2,"n_vocab":248094,"n_ctx":262144,"n_ctx_train":262144,"n_embd":1024,"n_params":752161600,"size":518145904}}
0.32.966.450 I srv  proxy_reques: proxying request to model MiniCPM-V-4_6-Q4_K_M on port 51243
[51243] 0.01.938.689 I srv  update_slots: all slots are idle
[51243] 0.01.938.694 I srv    operator(): child server monitoring thread started, waiting for EOF on stdin...
[51243] 0.01.939.675 W srv    operator(): got exception: {"error":{"code":500,"message":"image input is not supported - hint: if this is unexpected, you may need to provide the mmproj","type":"server_error"}}

Tested with Q4, then F16, with mmproj:

image

OpenBMB org

@fawogin598
This is a usage/configuration issue rather than a model support issue.
The "mmproj" field in the OpenAI request body is not supported and will not load the projector.
The projector must be specified when starting llama.cpp:

llama-server \
  -m MiniCPM-V-4_6-Q4_K_M.gguf \
  --mmproj mmproj-model-f16.gguf

You can refer to this document for guidance. It might be helpful.
https://github.com/OpenSQZ/MiniCPM-V-CookBook/blob/main/deployment/llama.cpp/minicpm-v4_6_llamacpp.md

Sign up or log in to comment