interface

This commit is contained in:
Josh Yan 2024-07-12 10:02:58 -07:00
parent e75fb73839
commit 554f3bdc0e
2 changed files with 4 additions and 3 deletions

View File

@ -29,8 +29,6 @@ func NewLayer(r io.Reader, mediatype string) (*Layer, error) {
defer os.Remove(temp.Name())
sha256sum := sha256.New()
if
n, err := io.Copy(io.MultiWriter(temp, sha256sum), r)
if err != nil {
return nil, err

View File

@ -244,8 +244,11 @@ func parseFromFile(ctx context.Context, file *os.File, digest string, fn func(ap
var reader io.Reader = io.NewSectionReader(file, offset, n)
if !sort.IsSorted(ggml.Tensors()) {
// create a new Tensors containing Tensors that have a writeTo
reader = &llm.GGUFWriter{
KV: ggml.KV(),
KV: ggml.KV(),
// Update .Tensors
Tensors: ggml.Tensors(),
}
}