Merge pull request #3002 from 50h100a/streamprobs Correctly view token probabilities when 'Continue'-ing a response.
Signed| @@ -56,6 +56,7 @@ | ||
| 56 | 56 | user-select: none; |
| 57 | 57 | height: 100%; |
| 58 | 58 | overflow-y: auto; |
| 59 | + word-break: break-all; | |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | .logprobs_empty_state { |
| @@ -3194,7 +3194,8 @@ class StreamingProcessor { | ||
| 3194 | 3194 | } |
| 3195 | 3195 | |
| 3196 | 3196 | onStopStreaming() { |
| 3197 | 3197 | this.onErrorStreamingabortController.abort(); |
| 3198 | + this.isFinished = true; | |
| 3198 | 3199 | } |
| 3199 | 3200 | |
| 3200 | 3201 | /** |
| @@ -3239,9 +3240,12 @@ class StreamingProcessor { | ||
| 3239 | 3240 | console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`); |
| 3240 | 3241 | } |
| 3241 | 3242 | catch (err) { |
| 3243 | + // in the case of a self-inflicted abort, we have already cleaned up | |
| 3244 | + if (!this.isFinished) { | |
| 3242 | 3245 | console.error(err); |
| 3243 | 3246 | this.onErrorStreaming(); |
| 3244 | - return; | |
| 3247 | + } | |
| 3248 | + return this.result; | |
| 3245 | 3249 | } |
| 3246 | 3250 | |
| 3247 | 3251 | this.isFinished = true; |
| @@ -4641,7 +4645,6 @@ export function stopGeneration() { | ||
| 4641 | 4645 | let stopped = false; |
| 4642 | 4646 | if (streamingProcessor) { |
| 4643 | 4647 | streamingProcessor.onStopStreaming(); |
| 4644 | - streamingProcessor = null; | |
| 4645 | 4648 | stopped = true; |
| 4646 | 4649 | } |
| 4647 | 4650 | if (abortController) { |