Spaces:
Runtime error
Runtime error
Commit
·
dfa9dfa
1
Parent(s):
63cbb96
Fix: syntax indentations
Browse files
app.py
CHANGED
|
@@ -108,49 +108,49 @@ with gr.Blocks(theme=theme) as demo:
|
|
| 108 |
qa_history = gr.State([])
|
| 109 |
qa_counter = gr.State(0)
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
)
|
| 127 |
-
gr.Markdown("### Ask Questions About the Transcript")
|
| 128 |
-
gr.Markdown("You can ask up to **5 follow-up questions** per transcript")
|
| 129 |
-
|
| 130 |
-
chatbot = gr.Chatbot(
|
| 131 |
-
height=400,
|
| 132 |
-
label="Conversation History",
|
| 133 |
-
bubble_full_width=False
|
| 134 |
-
)
|
| 135 |
-
|
| 136 |
-
with gr.Row():
|
| 137 |
-
question_input = gr.Textbox(
|
| 138 |
-
label="Your Question",
|
| 139 |
-
placeholder="e.g., What was the main topic? Why did they say that? What happened next?",
|
| 140 |
-
scale=4
|
| 141 |
)
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
-
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
|
| 155 |
# Event handlers
|
| 156 |
transcribe_btn.click(
|
|
|
|
| 108 |
qa_history = gr.State([])
|
| 109 |
qa_counter = gr.State(0)
|
| 110 |
|
| 111 |
+
with gr.Row():
|
| 112 |
+
with gr.Column():
|
| 113 |
+
gr.Markdown("Record yourself using your microphone or upload an audio file")
|
| 114 |
+
audio_input = gr.Audio(
|
| 115 |
+
sources=["microphone", "upload"],
|
| 116 |
+
type="filepath",
|
| 117 |
+
label="Record/Upload Audio (MP3, WAV, M4A, etc.)"
|
| 118 |
+
)
|
| 119 |
+
transcribe_btn = gr.Button("Transcribe Audio", variant="primary", size="lg")
|
| 120 |
|
| 121 |
+
with gr.Column():
|
| 122 |
+
transcript_output = gr.Textbox(
|
| 123 |
+
label="Transcript",
|
| 124 |
+
lines=12,
|
| 125 |
+
placeholder="Transcript will appear here..."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
)
|
| 127 |
+
gr.Markdown("### Ask Questions About the Transcript")
|
| 128 |
+
gr.Markdown("You can ask up to **5 follow-up questions** per transcript")
|
| 129 |
+
|
| 130 |
+
chatbot = gr.Chatbot(
|
| 131 |
+
height=400,
|
| 132 |
+
label="Conversation History",
|
| 133 |
+
bubble_full_width=False
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
with gr.Row():
|
| 137 |
+
question_input = gr.Textbox(
|
| 138 |
+
label="Your Question",
|
| 139 |
+
placeholder="e.g., What was the main topic? Why did they say that? What happened next?",
|
| 140 |
+
scale=4
|
| 141 |
+
)
|
| 142 |
+
ask_btn = gr.Button("Ask", variant="primary", scale=1)
|
| 143 |
|
| 144 |
+
clear_chat_btn = gr.Button("Clear Chat", variant="secondary")
|
| 145 |
|
| 146 |
+
gr.Markdown("""
|
| 147 |
+
### Example Questions to Try:
|
| 148 |
+
- What was this about?
|
| 149 |
+
- What were the key points discussed?
|
| 150 |
+
- Why did they mention [specific topic]?
|
| 151 |
+
- What was the conclusion?
|
| 152 |
+
- Can you explain [concept] in simpler terms?
|
| 153 |
+
""")
|
| 154 |
|
| 155 |
# Event handlers
|
| 156 |
transcribe_btn.click(
|