mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into continue-from-reasoning
This commit is contained in:
@@ -271,7 +271,7 @@ import { initSettingsSearch } from './scripts/setting-search.js';
|
||||
import { initBulkEdit } from './scripts/bulk-edit.js';
|
||||
import { deriveTemplatesFromChatTemplate } from './scripts/chat-templates.js';
|
||||
import { getContext } from './scripts/st-context.js';
|
||||
import { extractReasoningFromData, initReasoning, PromptReasoning, ReasoningHandler, removeReasoningFromString, updateReasoningUI } from './scripts/reasoning.js';
|
||||
import { extractReasoningFromData, initReasoning, parseReasoningInSwipes, PromptReasoning, ReasoningHandler, removeReasoningFromString, updateReasoningUI } from './scripts/reasoning.js';
|
||||
import { accountStorage } from './scripts/util/AccountStorage.js';
|
||||
|
||||
// API OBJECT FOR EXTERNAL WIRING
|
||||
@@ -3346,15 +3346,18 @@ class StreamingProcessor {
|
||||
|
||||
if (Array.isArray(this.swipes) && this.swipes.length > 0) {
|
||||
const message = chat[messageId];
|
||||
const swipeInfoExtra = structuredClone(message.extra ?? {});
|
||||
delete swipeInfoExtra.token_count;
|
||||
delete swipeInfoExtra.reasoning;
|
||||
delete swipeInfoExtra.reasoning_duration;
|
||||
const swipeInfo = {
|
||||
send_date: message.send_date,
|
||||
gen_started: message.gen_started,
|
||||
gen_finished: message.gen_finished,
|
||||
extra: structuredClone(message.extra),
|
||||
extra: swipeInfoExtra,
|
||||
};
|
||||
const swipeInfoArray = [];
|
||||
swipeInfoArray.length = this.swipes.length;
|
||||
swipeInfoArray.fill(swipeInfo);
|
||||
const swipeInfoArray = Array(this.swipes.length).fill().map(() => structuredClone(swipeInfo));
|
||||
parseReasoningInSwipes(this.swipes, swipeInfoArray, message.extra?.reasoning_duration);
|
||||
chat[messageId].swipes.push(...this.swipes);
|
||||
chat[messageId].swipe_info.push(...swipeInfoArray);
|
||||
}
|
||||
@@ -3366,6 +3369,7 @@ class StreamingProcessor {
|
||||
await eventSource.emit(event_types.IMPERSONATE_READY, text);
|
||||
}
|
||||
|
||||
syncMesToSwipe(messageId);
|
||||
saveLogprobsForActiveMessage(this.messageLogprobs.filter(Boolean), this.continueMessage);
|
||||
await saveChatConditional();
|
||||
unblockGeneration();
|
||||
@@ -6117,15 +6121,18 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes,
|
||||
}
|
||||
|
||||
if (Array.isArray(swipes) && swipes.length > 0) {
|
||||
const swipeInfoExtra = structuredClone(item.extra ?? {});
|
||||
delete swipeInfoExtra.token_count;
|
||||
delete swipeInfoExtra.reasoning;
|
||||
delete swipeInfoExtra.reasoning_duration;
|
||||
const swipeInfo = {
|
||||
send_date: item.send_date,
|
||||
gen_started: item.gen_started,
|
||||
gen_finished: item.gen_finished,
|
||||
extra: structuredClone(item.extra),
|
||||
extra: swipeInfoExtra,
|
||||
};
|
||||
const swipeInfoArray = [];
|
||||
swipeInfoArray.length = swipes.length;
|
||||
swipeInfoArray.fill(swipeInfo, 0, swipes.length);
|
||||
const swipeInfoArray = Array(swipes.length).fill().map(() => structuredClone(swipeInfo));
|
||||
parseReasoningInSwipes(swipes, swipeInfoArray, item.extra?.reasoning_duration);
|
||||
item.swipes.push(...swipes);
|
||||
item.swipe_info.push(...swipeInfoArray);
|
||||
}
|
||||
|
Reference in New Issue
Block a user