2023-07-14 23:19:43 +00:00
|
|
|
package grpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
pb "github.com/go-skynet/LocalAI/pkg/grpc/proto"
|
2023-07-14 23:19:43 +00:00
|
|
|
"github.com/go-skynet/LocalAI/pkg/grpc/whisper/api"
|
2023-07-14 23:19:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type LLM interface {
|
|
|
|
Predict(*pb.PredictOptions) (string, error)
|
2023-07-14 23:19:43 +00:00
|
|
|
PredictStream(*pb.PredictOptions, chan string) error
|
2023-07-14 23:19:43 +00:00
|
|
|
Load(*pb.ModelOptions) error
|
2023-07-14 23:19:43 +00:00
|
|
|
Embeddings(*pb.PredictOptions) ([]float32, error)
|
2023-07-14 23:19:43 +00:00
|
|
|
GenerateImage(*pb.GenerateImageRequest) error
|
|
|
|
AudioTranscription(*pb.TranscriptRequest) (api.Result, error)
|
|
|
|
TTS(*pb.TTSRequest) error
|
2023-07-14 23:19:43 +00:00
|
|
|
}
|
2023-07-27 16:41:04 +00:00
|
|
|
|
|
|
|
func newReply(s string) *pb.Reply {
|
|
|
|
return &pb.Reply{Message: []byte(s)}
|
|
|
|
}
|