detect chat template from KV

This commit is contained in:
Michael Yang
2024-06-03 11:06:29 -07:00
parent 1a29e9a879
commit 9b6c2e6eb6
26 changed files with 428 additions and 0 deletions

View File

@@ -81,6 +81,11 @@ func (kv KV) ContextLength() uint64 {
return kv.u64(fmt.Sprintf("%s.context_length", kv.Architecture()))
}
func (kv KV) ChatTemplate() string {
s, _ := kv["tokenizer.chat_template"].(string)
return s
}
type Tensors []*Tensor
func (ts Tensors) Layers() map[string]Layer {