Merge pull request #3111 from kallewoof/202411-avoid-missing-ct Template derivation: explicitly skip empty templates

0143ce199ae7e0ed687821d3b20804f9241e0133

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +5 -0Showing whitespace changes
public/scripts/chat-templates.js+5 -0
@@ -65,6 +65,11 @@ const parse_derivation = derivation => (typeof derivation === 'string') ? {
65} : derivation;65} : derivation;
6666
67export async function deriveTemplatesFromChatTemplate(chat_template, hash) {67export async function deriveTemplatesFromChatTemplate(chat_template, hash) {
68 if (chat_template.trim() === '') {
69 console.log('Missing chat template.');
70 return null;
71 }
72
68 if (hash in hash_derivations) {73 if (hash in hash_derivations) {
69 return parse_derivation(hash_derivations[hash]);74 return parse_derivation(hash_derivations[hash]);
70 }75 }