Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -276,83 +276,23 @@ def ask_help_agent(query):
|
|
276 |
|
277 |
|
278 |
def show_techniques_modal():
|
279 |
-
|
280 |
-
|
281 |
-
.
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
background: rgba(0,0,0,0.5);
|
288 |
-
z-index: 999;
|
289 |
-
display: block;
|
290 |
-
}
|
291 |
-
.info-modal {
|
292 |
-
position: fixed;
|
293 |
-
top: 50%;
|
294 |
-
left: 50%;
|
295 |
-
transform: translate(-50%, -50%);
|
296 |
-
background: white;
|
297 |
-
padding: 2rem;
|
298 |
-
border-radius: 20px;
|
299 |
-
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
|
300 |
-
z-index: 1000;
|
301 |
-
max-width: 600px;
|
302 |
-
width: 90%;
|
303 |
-
}
|
304 |
-
.close-modal-btn {
|
305 |
-
position: absolute;
|
306 |
-
top: 1rem;
|
307 |
-
right: 1rem;
|
308 |
-
background: none;
|
309 |
-
border: none;
|
310 |
-
font-size: 1.5rem;
|
311 |
-
cursor: pointer;
|
312 |
-
color: #64748B;
|
313 |
-
}
|
314 |
-
</style>
|
315 |
-
|
316 |
-
<div class="info-modal-backdrop" id="infoBackdrop">
|
317 |
-
<div class="info-modal">
|
318 |
-
<button class="close-modal-btn" onclick="window.parent.document.getElementById('infoBackdrop').style.display='none'">×</button>
|
319 |
-
<h3 style="color: #6C63FF; margin-bottom: 1.5rem; text-align: center;">Project Techniques & Limitations</h3>
|
320 |
-
|
321 |
-
<p><strong>AI Models Used:</strong></p>
|
322 |
-
<ol>
|
323 |
-
<li>Groq Llama 3.3-70B - For generating strategic questions and final guesses</li>
|
324 |
-
<li>Mistral Tiny - Powers the help chat assistant</li>
|
325 |
-
<li>OpenAI Whisper - Converts speech to text in real-time</li>
|
326 |
-
<li>Hard Prompt Tuning - Carefully engineered prompts to optimize model performance</li>
|
327 |
-
</ol>
|
328 |
-
|
329 |
-
<p><strong>Known Limitations:</strong></p>
|
330 |
-
<ol>
|
331 |
-
<li>Voice input may take 5-10 seconds to process sentences (which is fine)</li>
|
332 |
-
<li>Single words (like "yes", "object") may take 10-20 seconds</li>
|
333 |
-
<li>Language Support - While Whisper understands Urdu, the game only supports English responses</li>
|
334 |
-
</ol>
|
335 |
-
</div>
|
336 |
-
</div>
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
if (frame.contentWindow === window) {
|
344 |
-
frame.parentNode.querySelector('.info-modal-backdrop').style.display = 'none';
|
345 |
-
}
|
346 |
-
});
|
347 |
-
}
|
348 |
|
349 |
-
|
350 |
-
|
351 |
-
var closeBtn = document.querySelector('.close-modal-btn');
|
352 |
-
closeBtn.onclick = closeModal;
|
353 |
-
};
|
354 |
-
</script>
|
355 |
-
""", unsafe_allow_html=True)
|
356 |
|
357 |
######################################
|
358 |
# Main Game Logic with Voice Integration
|
@@ -365,7 +305,6 @@ def main():
|
|
365 |
|
366 |
if st.button("ℹ️ Project Techniques & Limitations", key="info_btn"):
|
367 |
show_techniques_modal()
|
368 |
-
st.experimental_rerun()
|
369 |
|
370 |
|
371 |
if 'game_state' not in st.session_state:
|
|
|
276 |
|
277 |
|
278 |
def show_techniques_modal():
|
279 |
+
# Use Streamlit's expander with markdown
|
280 |
+
with st.expander("ℹ️ Project Techniques & Limitations", expanded=True):
|
281 |
+
st.markdown("""
|
282 |
+
**AI Models Used:**
|
283 |
+
1. Groq Llama 3.3-70B - For generating strategic questions and final guesses
|
284 |
+
2. Mistral Tiny - Powers the help chat assistant
|
285 |
+
3. OpenAI Whisper - Converts speech to text in real-time
|
286 |
+
4. Hard Prompt Tuning - Carefully engineered prompts to optimize model performance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
|
288 |
+
**Known Limitations:**
|
289 |
+
1. Voice input may take 5-10 seconds to process sentences (which is fine)
|
290 |
+
2. Single words (like "yes", "object") may take 10-20 minutes, which is irritating
|
291 |
+
3. Language Support - While Whisper understands and write Urdu, the game only supports English responses
|
292 |
+
""")
|
|
|
|
|
|
|
|
|
|
|
293 |
|
294 |
+
if st.button("Close", key="modal_close_btn"):
|
295 |
+
pass # The expander will automatically close
|
|
|
|
|
|
|
|
|
|
|
296 |
|
297 |
######################################
|
298 |
# Main Game Logic with Voice Integration
|
|
|
305 |
|
306 |
if st.button("ℹ️ Project Techniques & Limitations", key="info_btn"):
|
307 |
show_techniques_modal()
|
|
|
308 |
|
309 |
|
310 |
if 'game_state' not in st.session_state:
|