Fix text display on stream abort

This commit is contained in:
Cohee
2025-02-04 10:16:26 +02:00
parent da531f12c2
commit 6ececb2ceb

View File

@ -3423,7 +3423,7 @@ class StreamingProcessor {
for await (const { text, swipes, logprobs, toolCalls, state } of this.generator()) { for await (const { text, swipes, logprobs, toolCalls, state } of this.generator()) {
timestamps.push(Date.now()); timestamps.push(Date.now());
if (this.isStopped || this.abortController.signal.aborted) { if (this.isStopped || this.abortController.signal.aborted) {
return; return this.result;
} }
this.toolCalls = toolCalls; this.toolCalls = toolCalls;