mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#2267 Fix multiswipe mutating the array returning by the streaming provider
This commit is contained in:
@ -2889,6 +2889,9 @@ class StreamingProcessor {
|
|||||||
this.onErrorStreaming();
|
this.onErrorStreaming();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {Generator<{ text: string, swipes: string[], logprobs: import('./scripts/logprobs.js').TokenLogprobs }, void, void>}
|
||||||
|
*/
|
||||||
*nullStreamingGeneration() {
|
*nullStreamingGeneration() {
|
||||||
throw new Error('Generation function for streaming is not hooked up');
|
throw new Error('Generation function for streaming is not hooked up');
|
||||||
}
|
}
|
||||||
@ -2916,7 +2919,7 @@ class StreamingProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.result = text;
|
this.result = text;
|
||||||
this.swipes = swipes;
|
this.swipes = Array.from(swipes ?? []);
|
||||||
if (logprobs) {
|
if (logprobs) {
|
||||||
this.messageLogprobs.push(...(Array.isArray(logprobs) ? logprobs : [logprobs]));
|
this.messageLogprobs.push(...(Array.isArray(logprobs) ? logprobs : [logprobs]));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user