Ngoufack commited on
Commit
50e3e8a
·
1 Parent(s): db1eac0
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -58,10 +58,8 @@ def transcribe(path, task):
58
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
59
 
60
  if path[-3:] != 'wav':
61
- with tempfile.TemporaryDirectory() as tmpdirname:
62
- filepath = os.path.join(tmpdirname, "audio.wav")
63
- subprocess.call(['ffmpeg', '-i', path, filepath, '-y'])
64
- path = filepath
65
  result = model.transcribe(path)
66
  segments = result["segments"]
67
  print(segments)
 
58
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
59
 
60
  if path[-3:] != 'wav':
61
+ subprocess.call(['ffmpeg', '-i', path, "audio.wav", '-y'])
62
+ path = "audio.wav"
 
 
63
  result = model.transcribe(path)
64
  segments = result["segments"]
65
  print(segments)