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