Spaces:
Running
Running
Commit
·
bde342d
1
Parent(s):
04c6dbe
switch tabs
Browse files
app.py
CHANGED
|
@@ -198,6 +198,27 @@ with gr.Blocks(title="Real-time Speech-to-Text with NeMo") as demo:
|
|
| 198 |
|
| 199 |
# Create tabs for real-time and file-based transcription
|
| 200 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
# Real-time transcription tab
|
| 202 |
with gr.TabItem("Real-time Transcription"):
|
| 203 |
with gr.Row():
|
|
@@ -225,27 +246,6 @@ with gr.Blocks(title="Real-time Speech-to-Text with NeMo") as demo:
|
|
| 225 |
placeholder="Real-time results will appear here...",
|
| 226 |
lines=2
|
| 227 |
)
|
| 228 |
-
# File-based transcription tab
|
| 229 |
-
with gr.TabItem("File Transcription"):
|
| 230 |
-
with gr.Row():
|
| 231 |
-
with gr.Column(scale=2):
|
| 232 |
-
# Audio recorder that saves to file
|
| 233 |
-
audio_recorder = gr.Audio(
|
| 234 |
-
sources=["microphone"],
|
| 235 |
-
type="filepath",
|
| 236 |
-
label="Record or upload audio file"
|
| 237 |
-
)
|
| 238 |
-
with gr.Row():
|
| 239 |
-
transcribe_btn = gr.Button("Transcribe Audio File", variant="primary")
|
| 240 |
-
clear_file_btn = gr.Button("Clear Transcript", variant="secondary")
|
| 241 |
-
|
| 242 |
-
with gr.Column(scale=3):
|
| 243 |
-
file_transcription = gr.Textbox(
|
| 244 |
-
label="File Transcription",
|
| 245 |
-
placeholder="Transcription will appear here after clicking 'Transcribe Audio File'",
|
| 246 |
-
lines=10
|
| 247 |
-
)
|
| 248 |
-
|
| 249 |
# State to store the ongoing transcription
|
| 250 |
state = gr.State("")
|
| 251 |
audio_buffer = gr.State(value=None)
|
|
|
|
| 198 |
|
| 199 |
# Create tabs for real-time and file-based transcription
|
| 200 |
with gr.Tabs():
|
| 201 |
+
|
| 202 |
+
# File-based transcription tab
|
| 203 |
+
with gr.TabItem("File Transcription"):
|
| 204 |
+
with gr.Row():
|
| 205 |
+
with gr.Column(scale=2):
|
| 206 |
+
# Audio recorder that saves to file
|
| 207 |
+
audio_recorder = gr.Audio(
|
| 208 |
+
sources=["microphone"],
|
| 209 |
+
type="filepath",
|
| 210 |
+
label="Record or upload audio file"
|
| 211 |
+
)
|
| 212 |
+
with gr.Row():
|
| 213 |
+
transcribe_btn = gr.Button("Transcribe Audio File", variant="primary")
|
| 214 |
+
clear_file_btn = gr.Button("Clear Transcript", variant="secondary")
|
| 215 |
+
|
| 216 |
+
with gr.Column(scale=3):
|
| 217 |
+
file_transcription = gr.Textbox(
|
| 218 |
+
label="File Transcription",
|
| 219 |
+
placeholder="Transcription will appear here after clicking 'Transcribe Audio File'",
|
| 220 |
+
lines=10
|
| 221 |
+
)
|
| 222 |
# Real-time transcription tab
|
| 223 |
with gr.TabItem("Real-time Transcription"):
|
| 224 |
with gr.Row():
|
|
|
|
| 246 |
placeholder="Real-time results will appear here...",
|
| 247 |
lines=2
|
| 248 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
# State to store the ongoing transcription
|
| 250 |
state = gr.State("")
|
| 251 |
audio_buffer = gr.State(value=None)
|