Documentation
¶
Overview ¶
Package embedding turns text into normalized vectors with a transformer model on the CPU. Model files are acquired and verified by the model registry before an engine loads them.
Index ¶
Constants ¶
const MaxInputTokens = 512
MaxInputTokens is the model window, special tokens and prefix included.
Variables ¶
var ErrTooLong = fmt.Errorf("embedding input exceeds the %d-token window", MaxInputTokens)
ErrTooLong reports an input that exceeds the model window. Inputs are never truncated.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is one loaded embedding model. It is not safe for concurrent use.
func Load ¶
func Load(definition *protocol.ModelsDefinition, directory string) (*Engine, error)
Load opens the model of a registered definition from its verified files.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package tokenizer reads the Hugging Face tokenizer.json components the pinned granite-multi embedding model uses and reproduces tokenizers 0.23.2 for them: added tokens, Split (Isolated) followed by ByteLevel pre-tokenization, BPE with ignore_merges and TemplateProcessing.
|
Package tokenizer reads the Hugging Face tokenizer.json components the pinned granite-multi embedding model uses and reproduces tokenizers 0.23.2 for them: added tokens, Split (Isolated) followed by ByteLevel pre-tokenization, BPE with ignore_merges and TemplateProcessing. |