mirror of
https://github.com/ollama/ollama.git
synced 2025-05-10 18:06:33 +02:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue