bug-fix: adhere to chat template hash bound settings when a new model appears using the same hash as a bound one (#4393)

* bug-fix: adhere to chat template hash bound settings when a new model appears using the same hash as a bound one

* chore: Improve readability

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
This commit is contained in:
kallewoof
2025-08-18 16:22:37 +09:00
committed by GitHub
parent d944581690
commit b6a055c766
+4 -1
View File
@@ -743,7 +743,10 @@ async function getStatusTextgen() {
}
}
console.log(`We have chat template ${chat_template.split('\n')[0]}...`);
const { context, instruct } = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
const savedTemplate = power_user.model_templates_mappings[chat_template_hash];
const derivedTemplate = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
const { context, instruct } = savedTemplate ?? derivedTemplate;
if (wantsContextDerivation && context) {
selectContextPreset(context, { isAuto: true });
}