fixes after rebase
This commit is contained in:
parent
32948ec952
commit
2521a55ae6
@ -56,8 +56,8 @@ func (q *qwen25VLModel) KV(t *Tokenizer) ggml.KV {
|
|||||||
return kv
|
return kv
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *qwen25VLModel) Tensors(ts []Tensor) []ggml.Tensor {
|
func (q *qwen25VLModel) Tensors(ts []Tensor) []*ggml.Tensor {
|
||||||
var out []ggml.Tensor
|
var out []*ggml.Tensor
|
||||||
|
|
||||||
for _, t := range ts {
|
for _, t := range ts {
|
||||||
if strings.Contains(t.Name(), "patch_embed.proj") {
|
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"),
|
strings.NewReplacer("attn.qkv", "attn_v"),
|
||||||
))...)
|
))...)
|
||||||
} else {
|
} else {
|
||||||
out = append(out, ggml.Tensor{
|
out = append(out, &ggml.Tensor{
|
||||||
Name: t.Name(),
|
Name: t.Name(),
|
||||||
Kind: t.Kind(),
|
Kind: t.Kind(),
|
||||||
Shape: t.Shape(),
|
Shape: t.Shape(),
|
||||||
|
@ -12,8 +12,8 @@ import (
|
|||||||
|
|
||||||
// splitDim splits a tensor along a specified dimension into multiple tensors. The dimension
|
// splitDim splits a tensor along a specified dimension into multiple tensors. The dimension
|
||||||
// is split evenly based on the number of replacers provided.
|
// is split evenly based on the number of replacers provided.
|
||||||
func splitDim(t Tensor, dim int, replacers ...*strings.Replacer) iter.Seq[ggml.Tensor] {
|
func splitDim(t Tensor, dim int, replacers ...*strings.Replacer) iter.Seq[*ggml.Tensor] {
|
||||||
return func(yield func(ggml.Tensor) bool) {
|
return func(yield func(*ggml.Tensor) bool) {
|
||||||
for i, replacer := range replacers {
|
for i, replacer := range replacers {
|
||||||
shape := slices.Clone(t.Shape())
|
shape := slices.Clone(t.Shape())
|
||||||
shape[dim] = shape[dim] / uint64(len(replacers))
|
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))
|
return native.VectorF32(t.(*tensor.Dense))
|
||||||
})
|
})
|
||||||
|
|
||||||
if !yield(ggml.Tensor{
|
if !yield(&ggml.Tensor{
|
||||||
Name: replacer.Replace(t.Name()),
|
Name: replacer.Replace(t.Name()),
|
||||||
Kind: t.Kind(),
|
Kind: t.Kind(),
|
||||||
Shape: shape,
|
Shape: shape,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user