embedding gemma model (#12181)

* ollama: add embeddings
This commit is contained in:
Michael Yang
2025-09-04 09:09:07 -07:00
committed by GitHub
parent b3e6120736
commit 5994e8e8fd
10 changed files with 175 additions and 27 deletions

View File

@@ -201,12 +201,11 @@ func (bpe BytePairEncoding) Encode(s string, addSpecial bool) ([]int32, error) {
}
}
logutil.Trace("encoded", "string", s, "ids", ids)
if addSpecial && len(ids) > 0 {
ids = bpe.vocab.addSpecials(ids)
}
logutil.Trace("encoded", "string", s, "ids", ids)
return ids, nil
}