base

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
}

Base is a base class for all backends to implement Note: the backends that does not support multiple requests should use SingleThread instead

func (*Base) AudioTranscription

func (llm *Base) AudioTranscription(*pb.TranscriptRequest) (schema.Result, error)

func (*Base) Busy added in v1.25.0

func (llm *Base) Busy() bool

func (*Base) Embeddings

func (llm *Base) Embeddings(opts *pb.PredictOptions) ([]float32, error)

func (*Base) GenerateImage

func (llm *Base) GenerateImage(*pb.GenerateImageRequest) error

func (*Base) Load

func (llm *Base) Load(opts *pb.ModelOptions) error

func (*Base) Lock added in v1.25.0

func (llm *Base) Lock()

func (*Base) Locking added in v1.25.0

func (llm *Base) Locking() bool

func (*Base) Predict

func (llm *Base) Predict(opts *pb.PredictOptions) (string, error)

func (*Base) PredictStream

func (llm *Base) PredictStream(opts *pb.PredictOptions, results chan string) error

func (*Base) Status added in v1.25.0

func (llm *Base) Status() (pb.StatusResponse, error)

backends may wish to call this to capture the gopsutil info, then enhance with additional memory usage details?

func (*Base) TTS

func (llm *Base) TTS(*pb.TTSRequest) error

func (*Base) TokenizeString added in v1.25.0

func (llm *Base) TokenizeString(opts *pb.PredictOptions) (pb.TokenizationResponse, error)

func (*Base) Unlock added in v1.25.0

func (llm *Base) Unlock()

type SingleThread added in v1.25.0

type SingleThread struct {
	Base
	// contains filtered or unexported fields
}

SingleThread are backends that does not support multiple requests. There will be only one request being served at the time. This is useful for models that are not thread safe and cannot run multiple requests at the same time.

func (*SingleThread) Busy added in v1.25.0

func (llm *SingleThread) Busy() bool

func (*SingleThread) Lock added in v1.25.0

func (llm *SingleThread) Lock()

func (*SingleThread) Locking added in v1.25.0

func (llm *SingleThread) Locking() bool

Locking returns true if the backend needs to lock resources

func (*SingleThread) Status added in v1.25.0

func (llm *SingleThread) Status() (pb.StatusResponse, error)

backends may wish to call this to capture the gopsutil info, then enhance with additional memory usage details?

func (*SingleThread) Unlock added in v1.25.0

func (llm *SingleThread) Unlock()

Jump to

Keyboard shortcuts

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