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>

b6a055c766ac6a40cfcd287080426e34e3d462e4

kallewoof <karljohan-alm@garage.co.jp>

Signed
1 files changed, +4 -1Ignore whitespace
public/scripts/textgen-settings.js+4 -1
@@ -743,7 +743,10 @@ async function getStatusTextgen() {
743 }743 }
744 }744 }
745 console.log(`We have chat template ${chat_template.split('\n')[0]}...`);745 console.log(`We have chat template ${chat_template.split('\n')[0]}...`);
746 const { context, instruct } = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);746 const savedTemplate = power_user.model_templates_mappings[chat_template_hash];
747 const derivedTemplate = await deriveTemplatesFromChatTemplate(chat_template, chat_template_hash);
748 const { context, instruct } = savedTemplate ?? derivedTemplate;
749
747 if (wantsContextDerivation && context) {750 if (wantsContextDerivation && context) {
748 selectContextPreset(context, { isAuto: true });751 selectContextPreset(context, { isAuto: true });
749 }752 }