Skip to content

Commit af31cce

Browse files
authored
fix data race in WriteGGUF (ollama#10598)
err in the go routine should not be shared with the outer scope
1 parent fa39355 commit af31cce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ggml/gguf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func WriteGGUF(f *os.File, kv KV, ts []*Tensor) error {
569569
t := t
570570
w := io.NewOffsetWriter(f, offset+int64(t.Offset))
571571
g.Go(func() error {
572-
_, err = t.WriteTo(w)
572+
_, err := t.WriteTo(w)
573573
return err
574574
})
575575
}

0 commit comments

Comments
 (0)