KEMBAR78
Handle either missing <think> start or </think> end tags by zombiegreedo · Pull Request #7102 · oobabooga/text-generation-webui · GitHub
Skip to content

Conversation

zombiegreedo
Copy link
Contributor

@zombiegreedo zombiegreedo commented Jun 26, 2025

The model I have been using frequently does not begin replies with <think> but does include the end </think> tag, and so most 'thoughts' weren't getting put into the nice looking UI boxes. This change fixes that issue, which I have tested. I did not see a way to accomplish this through the chat/instruction template.

It preserves the original handling of missing end </think> tags, and (I believe) fixes a potential bug on original line 120 (the lstrip means if the reply starts with whitespace before a <think> tag then content_start would be at the wrong index).

Checklist:

@oobabooga
Copy link
Owner

This is a good change, thanks!

@oobabooga oobabooga merged commit 877c651 into oobabooga:dev Jul 4, 2025
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.

2 participants