问题现象
整个think标签不对,如下图:

解决方案1:失败
参考:https://github.com/open-webui/open-webui/discussions/11348
This might be a quick fix:
in backend/open_webui/utils/middleware.py , line 1313, function tag_content_handler :
change the elif to if .
找到middlewares.py
cd /root/autodl-tmp/jacky/envs/open_webui/lib/python3.12/site-packages/open_webui/utils
vi middlewares.py
:1313 定位到那个elif,改成if
重启openwebui,问题依旧。
解决方案2:OK
参考:https://github.com/open-webui/open-webui/issues/11259
With TabbyAPI, I’m able to get the “normal” tag when removing it from the chat template.
The end looks like this after the modification:
{%- if add_generation_prompt %}\n {{- ‘<|im_start|>assistant\n’ }}\n{%- endif %}\n
找到模型位置
cd /root/autodl-tmp/HF_download/hub/models--Qwen--QwQ-32B-AWQ/snapshots/dc9f21221581580ccfa51b74077db6056b56cb69
vi tokenizer_config.json
搜索think,找到这儿,把那个think给删除了
重启vllm。open webui上的think标签恢复正常。