mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
Merge pull request #3002 from 50h100a/streamprobs
Correctly view token probabilities when 'Continue'-ing a response.
This commit is contained in:
commit
0a79d55983
@ -56,6 +56,7 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logprobs_empty_state {
|
.logprobs_empty_state {
|
||||||
|
@ -3194,7 +3194,8 @@ class StreamingProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStopStreaming() {
|
onStopStreaming() {
|
||||||
this.onErrorStreaming();
|
this.abortController.abort();
|
||||||
|
this.isFinished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3239,9 +3240,12 @@ class StreamingProcessor {
|
|||||||
console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`);
|
console.warn(`Stream stats: ${timestamps.length} tokens, ${seconds.toFixed(2)} seconds, rate: ${Number(timestamps.length / seconds).toFixed(2)} TPS`);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
// in the case of a self-inflicted abort, we have already cleaned up
|
||||||
|
if (!this.isFinished) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.onErrorStreaming();
|
this.onErrorStreaming();
|
||||||
return;
|
}
|
||||||
|
return this.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isFinished = true;
|
this.isFinished = true;
|
||||||
@ -4641,7 +4645,6 @@ export function stopGeneration() {
|
|||||||
let stopped = false;
|
let stopped = false;
|
||||||
if (streamingProcessor) {
|
if (streamingProcessor) {
|
||||||
streamingProcessor.onStopStreaming();
|
streamingProcessor.onStopStreaming();
|
||||||
streamingProcessor = null;
|
|
||||||
stopped = true;
|
stopped = true;
|
||||||
}
|
}
|
||||||
if (abortController) {
|
if (abortController) {
|
||||||
|
Loading…
Reference in New Issue
Block a user