Update app.py
Browse files
app.py
CHANGED
|
@@ -192,21 +192,18 @@ async def api_transcribe(request: Request):
|
|
| 192 |
)
|
| 193 |
|
| 194 |
# ====== Gradio 介面 ======
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
with demo:
|
| 198 |
gr.Markdown("# 🎧 LINE Audio Transcription")
|
| 199 |
|
| 200 |
with gr.Tab("Web Upload"):
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
summary = gr.Textbox(label="Summary", lines=5, show_copy_button=True)
|
| 208 |
|
| 209 |
-
btn.click(transcribe_ui, inputs=[pw,
|
| 210 |
|
| 211 |
with gr.Tab("API Info"):
|
| 212 |
gr.Markdown("""
|
|
|
|
| 192 |
)
|
| 193 |
|
| 194 |
# ====== Gradio 介面 ======
|
| 195 |
+
with gr.Blocks(title="LINE Audio Transcription") as demo:
|
|
|
|
|
|
|
| 196 |
gr.Markdown("# 🎧 LINE Audio Transcription")
|
| 197 |
|
| 198 |
with gr.Tab("Web Upload"):
|
| 199 |
+
pw = gr.Textbox(label="Password", type="password", placeholder="Enter password")
|
| 200 |
+
audio_file = gr.File(label="Upload Audio", file_types=["audio"])
|
| 201 |
+
btn = gr.Button("🚀 Start Transcription", variant="primary")
|
| 202 |
+
status = gr.Textbox(label="Status", interactive=False)
|
| 203 |
+
result = gr.Textbox(label="Transcription", lines=8, show_copy_button=True)
|
| 204 |
+
summary = gr.Textbox(label="Summary", lines=5, show_copy_button=True)
|
|
|
|
| 205 |
|
| 206 |
+
btn.click(transcribe_ui, inputs=[pw, audio_file], outputs=[status, result, summary])
|
| 207 |
|
| 208 |
with gr.Tab("API Info"):
|
| 209 |
gr.Markdown("""
|