Merge pull request #3044 from ollama/mxyng/fix-convert-shape

convert: fix shape
This commit is contained in:
Michael Yang 2024-03-11 09:56:57 -07:00 committed by GitHub
commit f878e91070
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,9 +103,9 @@ func ReadSafeTensors(fn string, offset uint64) ([]llm.Tensor, uint64, error) {
return []llm.Tensor{}, 0, err
}
shape := [4]uint64{1, 1, 1, 1}
for cnt, s := range data.Shape {
shape[cnt] = uint64(s)
shape := []uint64{0, 0, 0, 0}
for i := range data.Shape {
shape[i] = uint64(data.Shape[i])
}
t := llm.Tensor{