]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
server: tests: fetch random media marker via /apply-template (#21962) (#21980)
authorPascal <redacted>
Thu, 16 Apr 2026 17:46:21 +0000 (19:46 +0200)
committerGitHub <redacted>
Thu, 16 Apr 2026 17:46:21 +0000 (20:46 +0300)
commit4adac43f6f5900baf442a7d5551d30457b300c72
tree240b5e93baf67bdec76ece6088148716a24d9ca0
parent9db77a020c97ac3b13b7c1bf4e0c5787001533e7
server: tests: fetch random media marker via /apply-template (#21962) (#21980)

* server: tests: fetch random media marker via /apply-template (#21962 fix)

* server: allow pinning media marker via LLAMA_MEDIA_MARKER env var

get_media_marker() checks LLAMA_MEDIA_MARKER at first call and uses it
as-is if set, falling back to the random marker otherwise.

Tests no longer need to fetch the marker dynamically via /apply-template:
the fixture sets LLAMA_MEDIA_MARKER=<__media__> so the hardcoded prompts
work as before.

Address review feedback from ngxson

* server: make get_media_marker() thread-safe via magic statics

Use a C++11 static local with a lambda initializer instead of a global
static with an empty-check. The runtime guarantees initialization exactly
once without explicit locking.

Address review feedback from ggerganov

* nits

* nits
tools/server/server-common.cpp
tools/server/tests/unit/test_vision_api.py