dindizz commited on
Commit
d64ef5c
·
verified ·
1 Parent(s): 079e633

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -14,12 +14,13 @@ def transcribe_audio(file_path):
14
 
15
  # Open the wav file
16
  try:
17
- with open(file_path, 'rb') as audio_file:
18
- response = openai.Audio.transcriptions.create(
19
- model="whisper-1", # specify the appropriate model for transcription
20
- file=audio_file,
21
- language='ta' # specify 'ta' for Tamil language
22
- )
 
23
  except Exception as e:
24
  return f"Error during transcription: {e}"
25
 
 
14
 
15
  # Open the wav file
16
  try:
17
+ audio_file = open(file_path, 'rb')
18
+ response = openai.Audio.transcribe(
19
+ model="whisper-1", # specify the appropriate model for transcription
20
+ file=audio_file,
21
+ language='ta' # specify 'ta' for Tamil language
22
+ )
23
+ audio_file.close()
24
  except Exception as e:
25
  return f"Error during transcription: {e}"
26