feat(api): allow to pass audios to backends (#3603)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-09-19 12:26:53 +02:00 committed by GitHub
parent fbb9facda4
commit 191bc2e50a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 5 deletions

View file

@ -31,9 +31,13 @@ func ComputeChoices(
for _, m := range req.Messages {
videos = append(videos, m.StringVideos...)
}
audios := []string{}
for _, m := range req.Messages {
audios = append(audios, m.StringAudios...)
}
// get the model function to call for the result
predFunc, err := backend.ModelInference(req.Context, predInput, req.Messages, images, videos, loader, *config, o, tokenCallback)
predFunc, err := backend.ModelInference(req.Context, predInput, req.Messages, images, videos, audios, loader, *config, o, tokenCallback)
if err != nil {
return result, backend.TokenUsage{}, err
}