--think to force any model to return reasoning_content (or just parse <think> for deepseek r1)

This commit is contained in:
ochafik 2025-02-05 12:16:37 +00:00
parent 5d60cebbcc
commit 9d7c3cc51b
9 changed files with 306 additions and 145 deletions

View file

@ -1962,6 +1962,15 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
params.use_jinja = true;
}
).set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_MAIN}).set_env("LLAMA_ARG_JINJA"));
add_opt(common_arg(
{"--think"},
"*experimental* thinking mode (default: disabled)\n"
"returns reasoning_content in messages, forcing model to think unless it supports native <think> tags (DeepSeek R1)\n"
"only supported for non-streamed responses",
[](common_params & params) {
params.think = true;
}
).set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_MAIN}).set_env("LLAMA_ARG_JINJA"));
add_opt(common_arg(
{"--chat-template"}, "JINJA_TEMPLATE",
string_format(