Skip to content
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

[InferenceClient - Automatic speech recognition] Infer content type header based on file extension #2827

Open
Wauplin opened this issue Feb 3, 2025 · 1 comment

Comments

@Wauplin
Copy link
Contributor

Wauplin commented Feb 3, 2025

Follow-up issue after #2706. The initial intent of the issue is still left to be done. Sending a content-type as header can be done like this:

client = InferenceClient(url, headers={"Content-Type": "audio/mpeg"})
response = client.automatic_speech_recognition("audio.mp3")

would be even better to automatically infer the content type header based on file extension. Only possible when input is passed as a filepath, not raw bytes.

Note: this is not specific to automatic_speech_recognition but to any "binary-only" task (AST, audio-to-audio, image classification, image-to-xxx, etc.). Only useful when binary is sent alone, not when sent as base64-encoded with other parameters.

@WizKnight
Copy link
Contributor

WizKnight commented Feb 7, 2025

Hi @Wauplin🤗, I would love to contribute to this.
Looking forward to your response!

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants