Text-to-speech inference API doesn't respect accept headers
When using the inference API using a restful HTTP call or the python library example, the returned audio is encoded in flac even though the accept headers have been set to wav or other supported encoding return type.Anyone else have success getting different encodings?
2023-06-06T06:14:00Z
Inference API or Inference Endpoints?
2023-06-06T14:55:30Z
Inference API.In fact the demo specifically writes/saves the file to example.wav but it is still actually encoded as .flac lol
2023-06-06T15:00:11Z
Well found a possible culprit:github.comhuggingface/api-inference-community/blob/c08dd1d13baae01440299d61f46fff67ddcfaa26/api_inference_community/routes.py#LL101C77-L101C77# Special case, right now everything is flac audio we can output
2023-06-06T18:21:58Z
Updated the api-inference-community repo with the required changes with this Pull Request:github.com/huggingface/api-inference-communityfeat: added mime accept headershuggingface:main←StephenHodgson:dev/audio-format-return-typesopened06:19PM - 06 Jun 23 UTCStephenHodgson+24-10- Added way to specify accept header mime types for returned audio content in a…specific format

This ensures that returned audio is in formats that is accepted by api clients that cannot convert or re-encode locally.

## Notes:

Potentially this can also be used to specify returned format for images as well, but can be easily added later.