Early stopping if prompt reasoning limit reached

This commit is contained in:
Cohee
2025-01-26 02:07:50 +02:00
parent 30426d21e7
commit 8fc880b69b
2 changed files with 15 additions and 0 deletions

View File

@@ -3846,6 +3846,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
const reasoning = new PromptReasoning();
for (let i = coreChat.length - 1; i >= 0; i--) {
if (reasoning.isLimitReached()) {
break;
}
coreChat[i] = { ...coreChat[i], mes: reasoning.addToMessage(coreChat[i].mes, coreChat[i].extra?.reasoning) };
}