template derivation: explicitly skip derivation attempt if chat_template is empty

eec20dab9514a1ad34368d7954dbacc5812f84d6

Karl-Johan Alm <karljohan-alm@garage.co.jp>

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