Prompt Whisper to know "Khoj" term for speech to text transcription

This commit is contained in:
Debanjum Singh Solanky 2024-09-11 13:51:51 -07:00
parent 3dcc8695b2
commit 04363a504c

View file

@ -9,5 +9,5 @@ async def transcribe_audio(audio_file: BufferedReader, model, client: OpenAI) ->
Transcribe audio file using Whisper model via OpenAI's API
"""
# Send the audio data to the Whisper API
response = await sync_to_async(client.audio.translations.create)(model=model, file=audio_file)
response = await sync_to_async(client.audio.translations.create)(model=model, file=audio_file, prompt="Khoj")
return response.text