Spaces:
Build error
Build error
Commit ·
7e99120
1
Parent(s): 2b2237c
Add various status-tracking features.
Browse files
app.py
CHANGED
|
@@ -5,12 +5,13 @@ model = WhisperModel("large-v3", device="cuda", compute_type="float16")
|
|
| 5 |
|
| 6 |
def transcribe(gradio_input_one_return_audio_filepath: str, gradio_input_two_return_beam_size: int):
|
| 7 |
"""Makes a call to transcribe the audio"""
|
|
|
|
| 8 |
segments, info = model.transcribe(
|
| 9 |
gradio_input_one_return_audio_filepath,
|
| 10 |
beam_size=gradio_input_two_return_beam_size,
|
| 11 |
language="en"
|
| 12 |
)
|
| 13 |
-
|
| 14 |
|
| 15 |
interface = gr.Interface(
|
| 16 |
fn = transcribe,
|
|
@@ -19,8 +20,8 @@ interface = gr.Interface(
|
|
| 19 |
gr.Slider(minimum = 1, maximum = 10, value = 5, step = 1, label="Beam size"),
|
| 20 |
],
|
| 21 |
outputs = [
|
| 22 |
-
gr.Markdown(label="Output Information"),
|
| 23 |
-
gr.Markdown(label="Transcription Output"),
|
| 24 |
],
|
| 25 |
title = "Minimum Whisper Transcription"
|
| 26 |
)
|
|
|
|
| 5 |
|
| 6 |
def transcribe(gradio_input_one_return_audio_filepath: str, gradio_input_two_return_beam_size: int):
|
| 7 |
"""Makes a call to transcribe the audio"""
|
| 8 |
+
yield "Running inference...", ""
|
| 9 |
segments, info = model.transcribe(
|
| 10 |
gradio_input_one_return_audio_filepath,
|
| 11 |
beam_size=gradio_input_two_return_beam_size,
|
| 12 |
language="en"
|
| 13 |
)
|
| 14 |
+
yield f"```{info}```", "\n".join([seg.text for seg in segments])
|
| 15 |
|
| 16 |
interface = gr.Interface(
|
| 17 |
fn = transcribe,
|
|
|
|
| 20 |
gr.Slider(minimum = 1, maximum = 10, value = 5, step = 1, label="Beam size"),
|
| 21 |
],
|
| 22 |
outputs = [
|
| 23 |
+
gr.Markdown(value="Waiting...", label="Output Information"),
|
| 24 |
+
gr.Markdown(value="Waiting...", label="Transcription Output"),
|
| 25 |
],
|
| 26 |
title = "Minimum Whisper Transcription"
|
| 27 |
)
|