onnx

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder struct {
	// contains filtered or unexported fields
}

func NewEmbedder

func NewEmbedder(modelPath, tokenizersPath, libpath string) (*Embedder, error)

Embedder initialize the dictionary and the brain

func (*Embedder) Close

func (e *Embedder) Close()

func (*Embedder) Embed

func (e *Embedder) Embed(text string) ([]float32, error)

Embed converts text into a 384-dimmension vector

func (*Embedder) EmbedDocuments

func (e *Embedder) EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)

type EmbedderInterface

type EmbedderInterface interface {
	Embed(text string) ([]float32, error)
	EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)
	Close()
}

EmbedderInterface defines the contract for embedding text into vectors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL