add conversion for microsoft phi 3 mini/medium 4k, 128

This commit is contained in:
Michael Yang
2024-06-03 15:53:58 -07:00
parent f7e3b9190f
commit 6ffb5cb017
7 changed files with 373 additions and 12 deletions

View File

@@ -27,6 +27,10 @@ func (Parameters) KV(t *Tokenizer) llm.KV {
"tokenizer.ggml.token_type": t.Vocabulary.Types,
}
if len(t.Merges) > 0 {
kv["tokenizer.ggml.merges"] = t.Merges
}
if t.Template != "" {
kv["tokenizer.chat_template"] = t.Template
}
@@ -89,6 +93,8 @@ func Convert(fsys fs.FS, ws io.WriteSeeker) error {
conv = &mixtral{}
case "GemmaForCausalLM":
conv = &gemma{}
case "Phi3ForCausalLM":
conv = &phi3{}
default:
return errors.New("unsupported architecture")
}