Browse Source

fix data race in WriteGGUF (#10598)

err in the go routine should not be shared with the outer scope
brucemacd/model-forward-test-ext
Daniel Hiltgen 11 months ago
committed by GitHub
parent
commit
af31ccefc0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      fs/ggml/gguf.go

2
fs/ggml/gguf.go

@ -569,7 +569,7 @@ func WriteGGUF(f *os.File, kv KV, ts []*Tensor) error {
t := t
w := io.NewOffsetWriter(f, offset+int64(t.Offset))
g.Go(func() error {
_, err = t.WriteTo(w)
_, err := t.WriteTo(w)
return err
})
}

Loading…
Cancel
Save