Skip to main content

Module embedding_model

Module embedding_model 

Source
Expand description

One GGUF path in, one embedding vector out.

Binds a tokenizer to a TextEncoder and owns the two steps between them that neither half should own alone: adding the model’s own special tokens ([CLS] … [SEP]) around the tokenizer’s pieces, and pooling the hidden states the way the checkpoint’s pooling_type says.

This is the type /v1/embeddings and the CLI both hold. It exists so neither of them has to know that bert is an encoder, that WordPiece does not add its own specials, or that CLS pooling means row zero.

Structs§

EmbeddingModel
A loaded embedding model: tokenizer + encoder + the checkpoint’s own pooling rule.

Enums§

EmbedError

Functions§

is_embedding_arch
True when general.architecture names an encoder / embedding model rather than something with an output head.