Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def transcribe(inputs, previous_transcription):
|
|
58 |
def clear():
|
59 |
return ""
|
60 |
|
61 |
-
with gr.Blocks() as
|
62 |
with gr.Column():
|
63 |
gr.Markdown(f"# Realtime Whisper Large V3 Turbo: \n Transcribe Audio in Realtime. This Demo uses the Checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers.\n Note: The first token takes about 5 seconds. After that, it works flawlessly.")
|
64 |
with gr.Row():
|
@@ -71,4 +71,21 @@ with gr.Blocks() as demo:
|
|
71 |
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output, latency_textbox], time_limit=45, stream_every=2, concurrency_limit=None)
|
72 |
clear_button.click(clear, outputs=[output])
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
demo.launch()
|
|
|
58 |
def clear():
|
59 |
return ""
|
60 |
|
61 |
+
with gr.Blocks() as microphone:
|
62 |
with gr.Column():
|
63 |
gr.Markdown(f"# Realtime Whisper Large V3 Turbo: \n Transcribe Audio in Realtime. This Demo uses the Checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers.\n Note: The first token takes about 5 seconds. After that, it works flawlessly.")
|
64 |
with gr.Row():
|
|
|
71 |
input_audio_microphone.stream(transcribe, [input_audio_microphone, output], [output, latency_textbox], time_limit=45, stream_every=2, concurrency_limit=None)
|
72 |
clear_button.click(clear, outputs=[output])
|
73 |
|
74 |
+
with gr.Blocks() as flie:
|
75 |
+
with gr.Column():
|
76 |
+
gr.Markdown(f"# Realtime Whisper Large V3 Turbo: \n Transcribe Audio in Realtime. This Demo uses the Checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers.\n Note: The first token takes about 5 seconds. After that, it works flawlessly.")
|
77 |
+
with gr.Row():
|
78 |
+
input_audio_microphone = gr.Audio(sources="upload", type="numpy")
|
79 |
+
output = gr.Textbox(label="Transcription", value="")
|
80 |
+
latency_textbox = gr.Textbox(label="Latency (seconds)", value="0.0", scale=0)
|
81 |
+
with gr.Row():
|
82 |
+
submit_button = gr.Button("Submit")
|
83 |
+
clear_button = gr.Button("Clear Output")
|
84 |
+
|
85 |
+
submit_button.clcik(transcribe, [input_audio_microphone, output], [output, latency_textbox], concurrency_limit=None)
|
86 |
+
clear_button.click(clear, outputs=[output])
|
87 |
+
|
88 |
+
with gr.Blocks() as demo:
|
89 |
+
gr.TabbedInterface([microphone, flie], ["Microphone", "Audio file"])
|
90 |
+
|
91 |
demo.launch()
|