Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,6 @@ pipe = pipeline("automatic-speech-recognition", model=model_id)
|
|
7 |
|
8 |
title = "Automatic Speech Recognition (ASR)"
|
9 |
description = """
|
10 |
-
Demo for automatic speech recognition in English. Demo uses [openai/whisper-tiny](https://huggingface.co/openai/whisper-tiny) checkpoint, which is based on OpenAI's Whisper model.
|
11 |
-
![Automatic Speech Recognition (ASR)](https://datasets-server.huggingface.co/assets/huggingface-course/audio-course-images/--/huggingface-course--audio-course-images/train/2/image/image.png "Diagram of Automatic Speech Recognition (ASR)")
|
12 |
"""
|
13 |
|
14 |
def transcribe_speech(filepath):
|
@@ -26,14 +24,6 @@ def transcribe_speech(filepath):
|
|
26 |
|
27 |
demo = gr.Blocks()
|
28 |
|
29 |
-
mic_transcribe = gr.Interface(
|
30 |
-
fn=transcribe_speech,
|
31 |
-
inputs=gr.Audio(source="microphone", type="filepath"),
|
32 |
-
outputs=gr.outputs.Textbox(),
|
33 |
-
title=title, # Fixed typo (tilte -> title)
|
34 |
-
description=description,
|
35 |
-
)
|
36 |
-
|
37 |
file_transcribe = gr.Interface(
|
38 |
fn=transcribe_speech,
|
39 |
inputs=gr.Audio(source="upload", type="filepath"),
|
@@ -45,8 +35,8 @@ file_transcribe = gr.Interface(
|
|
45 |
|
46 |
with demo:
|
47 |
gr.TabbedInterface(
|
48 |
-
[
|
49 |
-
["Transcribe
|
50 |
),
|
51 |
|
52 |
demo.launch()
|
|
|
7 |
|
8 |
title = "Automatic Speech Recognition (ASR)"
|
9 |
description = """
|
|
|
|
|
10 |
"""
|
11 |
|
12 |
def transcribe_speech(filepath):
|
|
|
24 |
|
25 |
demo = gr.Blocks()
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
file_transcribe = gr.Interface(
|
28 |
fn=transcribe_speech,
|
29 |
inputs=gr.Audio(source="upload", type="filepath"),
|
|
|
35 |
|
36 |
with demo:
|
37 |
gr.TabbedInterface(
|
38 |
+
[file_transcribe],
|
39 |
+
["Transcribe Audio File"],
|
40 |
),
|
41 |
|
42 |
demo.launch()
|