huang_de_jun commited on
Commit
6899b4f
·
1 Parent(s): 6a8111a

feat: add in-app project info modal with animated button

Browse files
Files changed (2) hide show
  1. README.md +28 -1
  2. app.py +97 -1
README.md CHANGED
@@ -145,7 +145,7 @@ uv run python app.py
145
 
146
  ## Acknowledgments
147
 
148
- Built for the HuggingFace MCP Hackathon (November 2024)
149
 
150
  Powered by:
151
  - [Anthropic Claude](https://anthropic.com) - AI reasoning and question generation
@@ -154,6 +154,33 @@ Powered by:
154
  - [Gradio](https://gradio.app) - UI framework
155
  - [HuggingFace](https://huggingface.co) - Hosting
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  ## License
158
 
159
  MIT
 
145
 
146
  ## Acknowledgments
147
 
148
+ Built for the MCP's 1st Birthday Hackathon by Hugging Face (November 2025)
149
 
150
  Powered by:
151
  - [Anthropic Claude](https://anthropic.com) - AI reasoning and question generation
 
154
  - [Gradio](https://gradio.app) - UI framework
155
  - [HuggingFace](https://huggingface.co) - Hosting
156
 
157
+ ## Challenges
158
+
159
+ ### Audio Transcription Timing Issues
160
+
161
+ The current implementation uses short audio chunk intervals for streaming transcription. However, this creates a significant problem:
162
+
163
+ - **Issue**: The transcription API cannot process chunks fast enough before the next chunk arrives
164
+ - **Result**: Only fragments of audio are being transcribed, causing substantial information loss
165
+ - **Impact**: The accumulated context is incomplete, leading to lower quality question generation
166
+
167
+ ## To-Do
168
+
169
+ ### High Priority
170
+
171
+ - [ ] **Experiment with audio buffering** - Implement a buffer that accumulates audio before sending to transcription API
172
+ - [ ] **Increase audio chunk interval** - Test longer intervals (e.g., 5-10 seconds instead of 1-2 seconds) to allow complete transcription
173
+ - [ ] **Add overlap between chunks** - Implement overlapping audio segments to prevent word cutoffs at boundaries
174
+
175
+ ### Future Improvements
176
+
177
+ - [ ] **Add useful MCPs** - Integrate additional MCP servers for enhanced capabilities:
178
+ - Academic paper search (for research talks)
179
+ - Company/organization lookup (for business presentations)
180
+ - Technical documentation search (for developer conferences)
181
+ - [ ] **Implement voice activity detection (VAD)** - Only transcribe when speech is detected
182
+ - [ ] **Add local transcription fallback** - Use local Whisper model when API latency is too high
183
+
184
  ## License
185
 
186
  MIT
app.py CHANGED
@@ -285,8 +285,70 @@ custom_css = """
285
  border-radius: 10px;
286
  margin-bottom: 15px;
287
  }
 
288
  .header h1 { margin: 0; font-size: 24px; }
289
  .header p { margin: 5px 0 0 0; opacity: 0.9; font-size: 14px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  .status-bar {
291
  background: #f0f9ff;
292
  padding: 8px 12px;
@@ -301,11 +363,45 @@ with gr.Blocks(css=custom_css, title="Ask The Right Question") as demo:
301
  # Session state
302
  state = gr.State(get_initial_state())
303
 
304
- # Header
305
  gr.HTML("""
306
  <div class="header">
307
  <h1>Ask The Right Question</h1>
308
  <p>Start listening and questions will generate automatically as the talk progresses</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  </div>
310
  """)
311
 
 
285
  border-radius: 10px;
286
  margin-bottom: 15px;
287
  }
288
+ .header { position: relative; }
289
  .header h1 { margin: 0; font-size: 24px; }
290
  .header p { margin: 5px 0 0 0; opacity: 0.9; font-size: 14px; }
291
+ .header .info-btn {
292
+ display: inline-block;
293
+ margin-top: 12px;
294
+ background: rgba(255,255,255,0.2);
295
+ border: 1px solid rgba(255,255,255,0.4);
296
+ color: white;
297
+ padding: 6px 16px;
298
+ border-radius: 20px;
299
+ cursor: pointer;
300
+ font-size: 13px;
301
+ font-weight: 500;
302
+ animation: pulse 2s ease-in-out infinite;
303
+ box-shadow: 0 0 0 0 rgba(255,255,255,0.4);
304
+ transition: background 0.2s;
305
+ }
306
+ .header .info-btn:hover {
307
+ background: rgba(255,255,255,0.3);
308
+ animation: none;
309
+ }
310
+ @keyframes pulse {
311
+ 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
312
+ 50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
313
+ 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
314
+ }
315
+ .info-modal {
316
+ display: none;
317
+ position: fixed;
318
+ top: 0; left: 0; right: 0; bottom: 0;
319
+ background: rgba(0,0,0,0.5);
320
+ z-index: 1000;
321
+ justify-content: center;
322
+ align-items: center;
323
+ }
324
+ .info-modal.show { display: flex; }
325
+ .info-modal-content {
326
+ background: white;
327
+ padding: 25px;
328
+ border-radius: 12px;
329
+ max-width: 600px;
330
+ max-height: 80vh;
331
+ overflow-y: auto;
332
+ position: relative;
333
+ margin: 20px;
334
+ line-height: 1.6;
335
+ }
336
+ .info-modal-content h2 { margin-top: 0; color: #667eea; }
337
+ .info-modal-content h3 { color: #764ba2; margin-top: 20px; }
338
+ .info-modal-content table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 14px; }
339
+ .info-modal-content th, .info-modal-content td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
340
+ .info-modal-content th { background: #f8f9fa; font-weight: 600; }
341
+ .info-modal .close-btn {
342
+ position: absolute;
343
+ top: 10px;
344
+ right: 15px;
345
+ background: none;
346
+ border: none;
347
+ font-size: 24px;
348
+ cursor: pointer;
349
+ color: #666;
350
+ }
351
+ .info-modal .close-btn:hover { color: #333; }
352
  .status-bar {
353
  background: #f0f9ff;
354
  padding: 8px 12px;
 
363
  # Session state
364
  state = gr.State(get_initial_state())
365
 
366
+ # Header with info button
367
  gr.HTML("""
368
  <div class="header">
369
  <h1>Ask The Right Question</h1>
370
  <p>Start listening and questions will generate automatically as the talk progresses</p>
371
+ <br>
372
+ <button class="info-btn" onclick="document.getElementById('infoModal').classList.add('show')">The problem we solve</button>
373
+ </div>
374
+
375
+ <!-- Info Modal -->
376
+ <div id="infoModal" class="info-modal" onclick="if(event.target===this) this.classList.remove('show')">
377
+ <div class="info-modal-content">
378
+ <button class="close-btn" onclick="document.getElementById('infoModal').classList.remove('show')">&times;</button>
379
+ <h2>Ask The Right Question</h2>
380
+ <p><strong>AI-powered assistant that helps you ask insightful questions during Q&A sessions at conferences, classes, and talks.</strong></p>
381
+
382
+ <h3>The Problem</h3>
383
+ <p>You're at a conference or talk. The speaker opens the floor for questions. Your mind goes blank. You want to ask something meaningful but coming up with good questions on the spot is hard.</p>
384
+
385
+ <h3>How It Works</h3>
386
+ <ol>
387
+ <li><strong>Listen</strong> - Record audio or paste text from the talk</li>
388
+ <li><strong>Research</strong> - AI researches speaker background and fact-checks claims</li>
389
+ <li><strong>Generate</strong> - Get thoughtful questions with explanations of why they're valuable</li>
390
+ </ol>
391
+
392
+ <h3>Question Types</h3>
393
+ <table>
394
+ <tr><th>Type</th><th>Purpose</th></tr>
395
+ <tr><td>CLARIFICATION</td><td>Seeks to understand better</td></tr>
396
+ <tr><td>DEPTH</td><td>Explores a topic more deeply</td></tr>
397
+ <tr><td>CONNECTION</td><td>Links to other fields or ideas</td></tr>
398
+ <tr><td>CHALLENGE</td><td>Probes assumptions respectfully</td></tr>
399
+ <tr><td>PRACTICAL</td><td>Asks about real-world application</td></tr>
400
+ <tr><td>FORWARD</td><td>Explores future implications</td></tr>
401
+ </table>
402
+
403
+ <p style="margin-top:20px; font-size:13px; color:#666;">Built for HuggingFace MCP Hackathon | Claude + Whisper + Tavily</p>
404
+ </div>
405
  </div>
406
  """)
407