count gemma3 vision tensors

This commit is contained in:
Michael Yang
2025-03-12 14:18:06 -07:00
parent 6b45b1d6b4
commit 033cec232a
2 changed files with 10 additions and 2 deletions

View File

@@ -611,6 +611,14 @@ func (llm GGML) VisionGraphSize() (weights, graphSize uint64) {
embeddingLength*numPatches*maxNumTiles +
9*embeddingLength*numPaddedPatches*maxNumTiles +
numPaddedPatches*maxNumTiles*numPaddedPatches*maxNumTiles*headCount)
case "gemma3":
for name, layer := range llm.Tensors().GroupLayers() {
if strings.HasPrefix(name, "v.") {
for _, tensor := range layer {
weights += tensor.Size()
}
}
}
}
return weights, graphSize
}