diff --git a/convert/convert_qwen25vl.go b/convert/convert_qwen25vl.go index 2a1df0acd..3237ab78e 100644 --- a/convert/convert_qwen25vl.go +++ b/convert/convert_qwen25vl.go @@ -56,8 +56,8 @@ func (q *qwen25VLModel) KV(t *Tokenizer) ggml.KV { return kv } -func (q *qwen25VLModel) Tensors(ts []Tensor) []ggml.Tensor { - var out []ggml.Tensor +func (q *qwen25VLModel) Tensors(ts []Tensor) []*ggml.Tensor { + var out []*ggml.Tensor for _, t := range ts { if strings.Contains(t.Name(), "patch_embed.proj") { @@ -75,7 +75,7 @@ func (q *qwen25VLModel) Tensors(ts []Tensor) []ggml.Tensor { strings.NewReplacer("attn.qkv", "attn_v"), ))...) } else { - out = append(out, ggml.Tensor{ + out = append(out, &ggml.Tensor{ Name: t.Name(), Kind: t.Kind(), Shape: t.Shape(), diff --git a/convert/tensor.go b/convert/tensor.go index 258ffe1dd..ffb22ead9 100644 --- a/convert/tensor.go +++ b/convert/tensor.go @@ -12,8 +12,8 @@ import ( // splitDim splits a tensor along a specified dimension into multiple tensors. The dimension // is split evenly based on the number of replacers provided. -func splitDim(t Tensor, dim int, replacers ...*strings.Replacer) iter.Seq[ggml.Tensor] { - return func(yield func(ggml.Tensor) bool) { +func splitDim(t Tensor, dim int, replacers ...*strings.Replacer) iter.Seq[*ggml.Tensor] { + return func(yield func(*ggml.Tensor) bool) { for i, replacer := range replacers { shape := slices.Clone(t.Shape()) shape[dim] = shape[dim] / uint64(len(replacers)) @@ -43,7 +43,7 @@ func splitDim(t Tensor, dim int, replacers ...*strings.Replacer) iter.Seq[ggml.T return native.VectorF32(t.(*tensor.Dense)) }) - if !yield(ggml.Tensor{ + if !yield(&ggml.Tensor{ Name: replacer.Replace(t.Name()), Kind: t.Kind(), Shape: shape,