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