Merge pull request #3002 from 50h100a/streamprobs Correctly view token probabilities when 'Continue'-ing a response.

0a79d55983be94cadbb57fe31717cd3fa51c16e7

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
2 files changed, +7 -3Showing whitespace changes
public/css/logprobs.css+1 -0
@@ -56,6 +56,7 @@
5656 user-select: none;
5757 height: 100%;
5858 overflow-y: auto;
59+ word-break: break-all;
5960}
6061
6162.logprobs_empty_state {
public/script.js+6 -3
@@ -3194,7 +3194,8 @@ class StreamingProcessor {
31943194 }
31953195
31963196 onStopStreaming() {
31973197 this.onErrorStreamingabortController.abort();
3198+ this.isFinished = true;
31983199 }
31993200
32003201 /**
@@ -3239,9 +3240,12 @@ class StreamingProcessor {
32393240 console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`);
32403241 }
32413242 catch (err) {
3243+ // in the case of a self-inflicted abort, we have already cleaned up
3244+ if (!this.isFinished) {
32423245 console.error(err);
32433246 this.onErrorStreaming();
3244- return;
3247+ }
3248+ return this.result;
32453249 }
32463250
32473251 this.isFinished = true;
@@ -4641,7 +4645,6 @@ export function stopGeneration() {
46414645 let stopped = false;
46424646 if (streamingProcessor) {
46434647 streamingProcessor.onStopStreaming();
4644- streamingProcessor = null;
46454648 stopped = true;
46464649 }
46474650 if (abortController) {