Documentation ¶
Overview ¶
Huggingface Text Embeddings Inference https://github.com/huggingface/text-embeddings-inference
package is a wrapper for the Huggingface text embeddings inference project that can be run locally for creating vector embeddings.
Index ¶
- Variables
- type Option
- func WithAPIBaseURL(url string) Option
- func WithBatchSize(batchSize int) Option
- func WithCookies(cookies map[string]string) Option
- func WithHeaders(headers map[string]string) Option
- func WithPoolSize(poolSize int) Option
- func WithStripNewLines(stripNewLines bool) Option
- func WithTimeout(dur time.Duration) Option
- func WithTruncate() Option
- type TextEmbeddingsInference
Constants ¶
This section is empty.
Variables ¶
var ErrMissingAPIBaseURL = errors.New("missing the API Base URL") //nolint:lll
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(emb *TextEmbeddingsInference)
func WithBatchSize ¶
WithBatchSize is an option for specifying the batch size.
func WithCookies ¶
WithCookies add request cookies.
func WithHeaders ¶
WithHeaders add request headers.
func WithPoolSize ¶
WithPoolSize is an option for specifying the number of goroutines.
func WithStripNewLines ¶
WithStripNewLines is an option for specifying the should it strip new lines.
func WithTruncate ¶
func WithTruncate() Option
WithTruncate set the embedder to truncate input length.
type TextEmbeddingsInference ¶
type TextEmbeddingsInference struct { StripNewLines bool BatchSize int // contains filtered or unexported fields }
func New ¶
func New(opts ...Option) (TextEmbeddingsInference, error)
func (TextEmbeddingsInference) EmbedDocuments ¶
func (e TextEmbeddingsInference) EmbedDocuments(_ context.Context, texts []string) ([][]float32, error)
EmbedDocuments creates one vector embedding for each of the texts.
func (TextEmbeddingsInference) EmbedQuery ¶
EmbedQuery embeds a single text.