mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
feat: more embedded models, coqui fixes, add model usage and description (#1556)
* feat: add model descriptions and usage * remove default model gallery * models: add embeddings and tts * docs: update table * docs: updates * images: cleanup pip cache after install * images: always run apt-get clean * ux: improve gRPC connection errors * ux: improve some messages * fix: fix coqui when no AudioPath is passed by * embedded: add more models * Add usage * Reorder table
This commit is contained in:
parent
0843fe6c65
commit
e19d7226f8
21 changed files with 216 additions and 45 deletions
|
@ -50,7 +50,7 @@ func (c *Client) setBusy(v bool) {
|
|||
c.Unlock()
|
||||
}
|
||||
|
||||
func (c *Client) HealthCheck(ctx context.Context) bool {
|
||||
func (c *Client) HealthCheck(ctx context.Context) (bool, error) {
|
||||
if !c.parallel {
|
||||
c.opMutex.Lock()
|
||||
defer c.opMutex.Unlock()
|
||||
|
@ -59,8 +59,7 @@ func (c *Client) HealthCheck(ctx context.Context) bool {
|
|||
defer c.setBusy(false)
|
||||
conn, err := grpc.Dial(c.address, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return false
|
||||
return false, err
|
||||
}
|
||||
defer conn.Close()
|
||||
client := pb.NewBackendClient(conn)
|
||||
|
@ -71,15 +70,14 @@ func (c *Client) HealthCheck(ctx context.Context) bool {
|
|||
|
||||
res, err := client.Health(ctx, &pb.HealthMessage{})
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
||||
return false
|
||||
return false, err
|
||||
}
|
||||
|
||||
if string(res.Message) == "OK" {
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
return false
|
||||
|
||||
return false, fmt.Errorf("health check failed: %s", res.Message)
|
||||
}
|
||||
|
||||
func (c *Client) Embeddings(ctx context.Context, in *pb.PredictOptions, opts ...grpc.CallOption) (*pb.EmbeddingResult, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue