fix data race in WriteGGUF (#10598)
err in the go routine should not be shared with the outer scope
This commit is contained in:
parent
fa393554b9
commit
af31ccefc0
@ -569,7 +569,7 @@ func WriteGGUF(f *os.File, kv KV, ts []*Tensor) error {
|
|||||||
t := t
|
t := t
|
||||||
w := io.NewOffsetWriter(f, offset+int64(t.Offset))
|
w := io.NewOffsetWriter(f, offset+int64(t.Offset))
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
_, err = t.WriteTo(w)
|
_, err := t.WriteTo(w)
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user