Documentation ¶
Index ¶
- type Base
- func (llm *Base) AudioTranscription(*pb.TranscriptRequest) (schema.Result, error)
- func (llm *Base) Busy() bool
- func (llm *Base) Embeddings(opts *pb.PredictOptions) ([]float32, error)
- func (llm *Base) GenerateImage(*pb.GenerateImageRequest) error
- func (llm *Base) Load(opts *pb.ModelOptions) error
- func (llm *Base) Lock()
- func (llm *Base) Locking() bool
- func (llm *Base) Predict(opts *pb.PredictOptions) (string, error)
- func (llm *Base) PredictStream(opts *pb.PredictOptions, results chan string) error
- func (llm *Base) Status() (pb.StatusResponse, error)
- func (llm *Base) TTS(*pb.TTSRequest) error
- func (llm *Base) TokenizeString(opts *pb.PredictOptions) (pb.TokenizationResponse, error)
- func (llm *Base) Unlock()
- type SingleThread
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 (*Base) Embeddings ¶
func (llm *Base) Embeddings(opts *pb.PredictOptions) ([]float32, error)
func (*Base) GenerateImage ¶
func (llm *Base) GenerateImage(*pb.GenerateImageRequest) 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) TokenizeString ¶ added in v1.25.0
func (llm *Base) TokenizeString(opts *pb.PredictOptions) (pb.TokenizationResponse, error)
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()