server: add Qwen3-Reranker instruction support#20009
server: add Qwen3-Reranker instruction support#20009schwebke wants to merge 2 commits intoggml-org:masterfrom
Conversation
|
May I suggest that this does not in fact require a second template, but merely checking that the variable |
|
@CISC I considered that approach, but was undecided on the best location for the default value — specifically whether it warrants a dedicated model property. And we would turn the template silently bad for all implementations unaware of the instruction substitution, including older versions of llama-server itself. What do you suggest? |
I don't follow? If you just add an |
It would in case of jinja templating. Quote from prev. #15824 however:
Current |
Ahhh, I see, didn't notice the weird formatting even. :) Well, that does indeed change things. |
This PR extends #15824 and adds optional support for the reranking task instruction
provided by Qwen3 Reranker:
Besides the generic web-query instruction in the
reranktemplate,convert_hf_to_gguf.pyadds a second templatererank_instructfollowingthe logic from the original model card:
If a
instructionstring property is provided when callingllama-serverand this template exists in the model,the custom instruction will be used for reranking.
If either is missing, the static
reranktemplate is used, maintaining existing behaviour.Usage examples: