decode ggla

This commit is contained in:
Michael Yang
2024-03-08 15:38:53 -08:00
parent 18979ad4a1
commit 76bdebbadf
5 changed files with 171 additions and 33 deletions

View File

@@ -473,7 +473,13 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars
}
defer bin.Close()
layer, err := NewLayer(bin, mediatype)
ggml, err := llm.DecodeGGML(bin)
if err != nil {
return err
}
sr := io.NewSectionReader(bin, 0, ggml.Size)
layer, err := NewLayer(sr, mediatype)
if err != nil {
return err
}