Spaces:
Runtime error
Runtime error
hugging_face_space
#1
by
irena - opened
app.py
CHANGED
|
@@ -13,13 +13,6 @@ def transcribe_video(url):
|
|
| 13 |
def transcribe_audio(audio):
|
| 14 |
text = pipe(audio)["text"]
|
| 15 |
return text
|
| 16 |
-
def transcribe_file(audio):
|
| 17 |
-
text = pipe(audio)["text"]
|
| 18 |
-
return text
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
| 24 |
|
| 25 |
|
|
@@ -31,18 +24,7 @@ audio = gr.Interface(
|
|
| 31 |
description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
|
| 32 |
)
|
| 33 |
|
| 34 |
-
|
| 35 |
-
fn=transcribe_file,
|
| 36 |
-
inputs=[
|
| 37 |
-
gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
| 38 |
-
],
|
| 39 |
-
outputs="text",
|
| 40 |
-
title="Whisper Small Swedish",
|
| 41 |
-
description=(
|
| 42 |
-
"Transcribe swedish audios"
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
)
|
| 46 |
|
| 47 |
video = gr.Interface(
|
| 48 |
fn=transcribe_video,
|
|
@@ -55,7 +37,20 @@ video = gr.Interface(
|
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
-
demo = gr.TabbedInterface([audio,
|
| 59 |
|
| 60 |
if __name__ == "__main__":
|
| 61 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
def transcribe_audio(audio):
|
| 14 |
text = pipe(audio)["text"]
|
| 15 |
return text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
|
|
|
|
| 24 |
description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
|
| 25 |
)
|
| 26 |
|
| 27 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
video = gr.Interface(
|
| 30 |
fn=transcribe_video,
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
+
demo = gr.TabbedInterface([audio, video], ["transcribe from recording", "transcribe from youtube url"])
|
| 41 |
|
| 42 |
if __name__ == "__main__":
|
| 43 |
+
demo.launch()
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|