Update app.py
Browse files
app.py
CHANGED
|
@@ -93,7 +93,11 @@ description = """
|
|
| 93 |
You can record or upload an audio sample (it will be automatically resampled to 16 kHz mono),
|
| 94 |
and view the transcription result below.
|
| 95 |
"""
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
with gr.Blocks(title=title) as demo:
|
| 98 |
gr.Markdown(f"# {title}\n{description}")
|
| 99 |
|
|
@@ -106,14 +110,22 @@ with gr.Blocks(title=title) as demo:
|
|
| 106 |
|
| 107 |
transcribe_btn = gr.Button("π Transcribe")
|
| 108 |
|
| 109 |
-
output_text = gr.Textbox(label="π© Transcription Output")
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
transcribe_btn.click(
|
| 112 |
fn=transcribe,
|
| 113 |
inputs=[audio_input],
|
| 114 |
outputs=[output_text]
|
| 115 |
)
|
| 116 |
|
|
|
|
| 117 |
# Local launch
|
| 118 |
if __name__ == "__main__":
|
| 119 |
demo.launch()
|
|
|
|
| 93 |
You can record or upload an audio sample (it will be automatically resampled to 16 kHz mono),
|
| 94 |
and view the transcription result below.
|
| 95 |
"""
|
| 96 |
+
examples = [
|
| 97 |
+
["audio1.wav"],
|
| 98 |
+
["audio2.wav"],
|
| 99 |
+
["examples/quranic_recitation.wav"]
|
| 100 |
+
]
|
| 101 |
with gr.Blocks(title=title) as demo:
|
| 102 |
gr.Markdown(f"# {title}\n{description}")
|
| 103 |
|
|
|
|
| 110 |
|
| 111 |
transcribe_btn = gr.Button("π Transcribe")
|
| 112 |
|
| 113 |
+
output_text = gr.Textbox(label="π© Transcription Output",lines=6)
|
| 114 |
+
gr.Examples(
|
| 115 |
+
examples=examples,
|
| 116 |
+
inputs=[audio_input],
|
| 117 |
+
outputs=[output_text],
|
| 118 |
+
fn=transcribe,
|
| 119 |
+
run_on_click=True,
|
| 120 |
+
label="Example Audios"
|
| 121 |
+
)
|
| 122 |
transcribe_btn.click(
|
| 123 |
fn=transcribe,
|
| 124 |
inputs=[audio_input],
|
| 125 |
outputs=[output_text]
|
| 126 |
)
|
| 127 |
|
| 128 |
+
|
| 129 |
# Local launch
|
| 130 |
if __name__ == "__main__":
|
| 131 |
demo.launch()
|