template derivation: explicitly skip derivation attempt if chat_template is empty

This commit is contained in:
Karl-Johan Alm
2024-11-25 15:36:46 +09:00
parent f6d0f7587c
commit eec20dab95

View File

@@ -65,6 +65,11 @@ const parse_derivation = derivation => (typeof derivation === 'string') ? {
} : derivation;
export async function deriveTemplatesFromChatTemplate(chat_template, hash) {
if (chat_template.trim() === '') {
console.log('Missing chat template.');
return null;
}
if (hash in hash_derivations) {
return parse_derivation(hash_derivations[hash]);
}