Illia56 commited on
Commit
5da4366
·
1 Parent(s): c4c9930

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,11 +23,12 @@ css = """.toast-wrap { display: none !important } """
23
 
24
 
25
 
26
- def transcribe(wav_path):
27
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
28
-
 
29
  return whisper_client.predict(
30
- wav_path, # str (filepath or URL to file) in 'inputs' Audio component
31
  "transcribe", # str in 'Task' Radio component
32
  api_name="/predict"
33
  )
 
23
 
24
 
25
 
26
+ def transcribe(audio):
27
  whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
28
+ with open("audio.wav", "wb") as f:
29
+ f.write(audio)
30
  return whisper_client.predict(
31
+ "audio.wav", # str (filepath or URL to file) in 'inputs' Audio component
32
  "transcribe", # str in 'Task' Radio component
33
  api_name="/predict"
34
  )