gobert

package module
v0.0.0-...-710044b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bert

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

func New

func New(model string) (*Bert, error)

func (*Bert) Embeddings

func (l *Bert) Embeddings(text string, opts ...PredictOption) ([]float32, error)

func (*Bert) Free

func (l *Bert) Free()

func (*Bert) TokenEmbeddings

func (l *Bert) TokenEmbeddings(tokens []int, opts ...PredictOption) ([]float32, error)

type PredictOption

type PredictOption func(p *PredictOptions)

func SetEmbeddingSize

func SetEmbeddingSize(es int) PredictOption

SetThreads sets the number of threads to use for text generation.

func SetThreads

func SetThreads(threads int) PredictOption

SetThreads sets the number of threads to use for text generation.

type PredictOptions

type PredictOptions struct {
	Threads       int
	EmbeddingSize int
}
var DefaultOptions PredictOptions = PredictOptions{
	Threads:       4,
	EmbeddingSize: 99999,
}

func NewPredictOptions

func NewPredictOptions(opts ...PredictOption) PredictOptions

Create a new PredictOptions object with the given options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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