server: fix streaming crashes#13786
Merged
ochafik merged 8 commits intoggml-org:masterfrom May 26, 2025
Merged
Conversation
Contributor
|
Yeah, it works! No issues so far after some quick testing. The server is no longer crashing. I'll poke around a little more later on when I have some time. |
|
Will your PR also tackle the issue described in #13774 ? |
Collaborator
Author
@PrideIsLife Taking care of this in #13800, thanks for bringing my attention to it! |
Collaborator
Author
|
Apologies to anyone tracking this branch, had to amend my email - google.com no more! - and force push! |
10 tasks
Member
|
Can confirm as well that it fixes my case. |
CISC
approved these changes
May 26, 2025
Member
CISC
left a comment
There was a problem hiding this comment.
I can't test right now, but this looks reasonable.
common/chat.cpp
Outdated
Comment on lines
1017
to
1024
| } else if (auto res = builder.try_find_regex(start_response_regex)) { | ||
| // If we didn't extract thoughts, prelude includes them. | ||
| builder.add_content(res->prelude); | ||
| if (auto res = builder.try_find_regex(end_response_regex)) { | ||
| builder.add_content(res->prelude); | ||
| // If we didn't extract thoughts, prelude includes them. | ||
| } else { |
Member
There was a problem hiding this comment.
Since you're not using res any more and this block is a no-op, perhaps change it to
if (!builder.try_find_regex(end_response_regex)) {
...
}Co-Authored-By: ochafik <ochafik@google.com>
…3.1 format. still not ideal but hopefully less prone to crash Co-Authored-By: ochafik <ochafik@google.com>
ngxson
approved these changes
May 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #12379
(also see #13785 which fixes non-chat streaming + stop regression)
This (+ other PR) hopefully fixes crashes such as reported here (cc/ @teleprint-me ) and there (cc/ @pwilkin )