feat: make initializer accept gRPC delay times (#900)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2023-08-16 01:11:32 +02:00 committed by GitHub
parent 7ffd21dbc8
commit 0ec695f9e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 60 additions and 4 deletions

View file

@ -21,6 +21,13 @@ func ModelTranscription(audio, language string, loader *model.ModelLoader, c con
model.WithAssetDir(o.AssetsDestination),
}
if c.GRPC.Attempts != 0 {
opts = append(opts, model.WithGRPCAttempts(c.GRPC.Attempts))
}
if c.GRPC.AttemptsSleepTime != 0 {
opts = append(opts, model.WithGRPCAttemptsDelay(c.GRPC.AttemptsSleepTime))
}
for k, v := range o.ExternalGRPCBackends {
opts = append(opts, model.WithExternalBackend(k, v))
}