llama: remove model loading for grammar (#10096)

This commit is contained in:
Parth Sareen
2025-04-24 11:51:19 -07:00
committed by GitHub
parent 40b10eee6d
commit a53d744b01
13 changed files with 521 additions and 107 deletions

View File

@@ -17,6 +17,10 @@ type SentencePieceModel struct {
var _ TextProcessor = (*SentencePieceModel)(nil)
func (spm SentencePieceModel) Vocabulary() *Vocabulary {
return spm.vocab
}
func NewSentencePieceModel(vocab *Vocabulary) SentencePieceModel {
slog.Debug("Tokens", "num tokens", len(vocab.Values), "vals", vocab.Values[:5], "scores", vocab.Scores[:5], "types", vocab.Types[:5])