Skip to content

chat: fix llama-server image placeholder issue for PaddleOCR-VL#19799

Closed
megemini wants to merge 1 commit intoggml-org:masterfrom
megemini:fix_paddleocrvl_template
Closed

chat: fix llama-server image placeholder issue for PaddleOCR-VL#19799
megemini wants to merge 1 commit intoggml-org:masterfrom
megemini:fix_paddleocrvl_template

Conversation

@megemini
Copy link
Copy Markdown
Contributor

Fix chat template of PaddleOCR-VL for llama-server command, which requires media_marker instead of image (see #18825 (comment))

This should be able to handle these case:

  • llama-server without --chat-template-file argument, and clean prompt without <__media__>
  • llama-cli without --chat-template-file argument, and clean prompt without <__media__>

Tested:

  • llama-server with command
./build/bin/llama-server -m /media/shun/bigdata/Models/PaddleOCR_VL_SFT/PaddleOCR-VL-1.5-GGUF.gguf \
  --mmproj /media/shun/bigdata/Models/PaddleOCR_VL_SFT/PaddleOCR-VL-1.5-GGUF-mmproj.gguf \
  --port 8111 --host 0.0.0.0 --ctx-size 131072 -n 4096 --temp 0 --jinja
image
  • llama-cli with command
./build/bin/llama-cli -m /media/shun/bigdata/Models/PaddleOCR_VL_SFT/PaddleOCR-VL-1.5-GGUF.gguf \
  --mmproj /media/shun/bigdata/Models/PaddleOCR_VL_SFT/PaddleOCR-VL-1.5-GGUF-mmproj.gguf \
  --color on\
  --image /home/shun/Pictures/display_formula_7.png \
  --prompt "Formula Recognition:" --temp 0
Screenshot from 2026-02-22 14-24-13

@ngxson is this a good way to fix this issue?

@megemini megemini requested a review from pwilkin as a code owner February 22, 2026 06:42
@ngxson
Copy link
Copy Markdown
Contributor

ngxson commented Feb 22, 2026

@ngxson is this a good way to fix this issue?

Are you being affiliated with Paddle team?

If yes, ask them to fix it themself.

@megemini
Copy link
Copy Markdown
Contributor Author

@zhang-prog PaddleOCR-VL need update template to fix this issue.

@megemini megemini closed this Feb 22, 2026
@pwilkin
Copy link
Copy Markdown
Member

pwilkin commented Feb 22, 2026

I'd prefer not to add any code that patches templates on the fly, that's a very bad practice. Either fix the template at the source or, if it's not possible, just provide a corrected template.

@megemini
Copy link
Copy Markdown
Contributor Author

I'd prefer not to add any code that patches templates on the fly, that's a very bad practice.

Agree ~~~

I think there may be three ways to fix this issue:

  • update template: depends on PaddleOCR team
  • update llama.cpp jinja parse code: a hard work
  • hot fix (what this pr did) : temporary solution

whatever, I upload the fixed templates:

https://modelscope.cn/models/megemini/PaddleOCR-VL-1.5-GGUF/files
https://modelscope.cn/models/megemini/PaddleOCR-VL-GGUF/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants