-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tts): Implement naive response_format for tts endpoint #4035
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: n-Arno <[email protected]>
566fa5b
to
0309351
Compare
One potential issue with this: For license reasons, not all of our images include ffmpeg. We'll need to verify the error handling works on systems and return an error in that situation? To be more clear: your function already -has- error handling, I think we just need to make sure the default option is to -not- format, and add some documentation that this option requires ffmpeg |
Indeed, i didn't consider the "problem" with ffmpeg licencing since i am rebuilding the image with I'll add a quick note and check (like i said, it's a very naive implementation, not something rock solid yet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good here, thanks @n-Arno !
I think it does already, no ? If no format is specified, wav is implied, which in turn does skip calling ffmpeg completely |
Indeed, if no format is given, wav is used and ffmpeg is not called. I think the idea was to avoid a failure due to its absence if a format is specified. I am adding a "simple" function like this to test if ffmpeg is ok:
Once the build is done, i'll do a quick test ok and i'll commit this "security" (if i figure how to squash two commits with a merge from master in between :D) |
gotcha, yes in this case we should error out in a sane way so the user is aware of the image limitation (no ffmpeg present). Can be done in a follow-up tho, if tests are passing I'd merge it as is, unless you want to improve it with the error propagation in this PR. |
As-Is, the error is propagated correctly, so a merge is possible. It does not fallback silently, but maybe that's is not a desired behaviour. |
Description
This PR fixes #2732
Notes for Reviewers
This is a naive implementation as a starting point / workaround. I coded and use it for Livekit Agent integration, since the default mp3 format is expected from OpenAI plugin. It leverage ffmpeg for conversion of the generated wav file at endpoint level, not backend level.
It is neither the best nor the prettiest but since it works, i contribute :D