Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,11 +23,12 @@ css = """.toast-wrap { display: none !important } """
|
|
23 |
|
24 |
|
25 |
|
26 |
-
def transcribe(
|
27 |
whisper_client = Client("https://sanchit-gandhi-whisper-large-v2.hf.space/")
|
28 |
-
|
|
|
29 |
return whisper_client.predict(
|
30 |
-
|
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 |
)
|