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

[Feature]: Support OpenAI speech-to-text interface v1/audio/[transcriptions,translations] #12130

Open
1 task done
mgoin opened this issue Jan 16, 2025 · 1 comment
Open
1 task done
Labels
feature request help wanted Extra attention is needed

Comments

@mgoin
Copy link
Member

mgoin commented Jan 16, 2025

🚀 The feature, motivation and pitch

Now that we have support for Whisper (#11280), we should consider implementing OpenAI's explicit speech-to-text API. Documentation is here https://platform.openai.com/docs/guides/speech-to-text

Example of v1/audio/transcriptions

from openai import OpenAI
client = OpenAI()

audio_file= open("/path/to/file/audio.mp3", "rb")
transcription = client.audio.transcriptions.create(
    model="whisper-1", 
    file=audio_file
)

print(transcription.text)

Example of v1/audio/translations

from openai import OpenAI
client = OpenAI()

audio_file = open("/path/to/file/german.mp3", "rb")
transcription = client.audio.translations.create(
    model="whisper-1", 
    file=audio_file,
)

print(transcription.text)

Alternatives

No response

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@DarkLight1337 DarkLight1337 added the help wanted Extra attention is needed label Jan 17, 2025
@Temirulan
Copy link

I believe this PR is related to this feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants