Update app.py
Browse files
app.py
CHANGED
@@ -337,7 +337,7 @@ def main():
|
|
337 |
if audio_file:
|
338 |
play_and_download_audio(audio_file)
|
339 |
|
340 |
-
elif st.button("π Search"):
|
341 |
st.session_state['old_val'] = voice_text
|
342 |
with st.spinner("Processing..."):
|
343 |
results = search.quick_search(edited_input, search.load_page())
|
@@ -364,7 +364,7 @@ def main():
|
|
364 |
with col3:
|
365 |
num_results = st.slider("Max results:", 1, 100, 20)
|
366 |
with col4:
|
367 |
-
search_button = st.button("π Search")
|
368 |
|
369 |
if (search_button or not st.session_state['initial_search_done']) and query:
|
370 |
st.session_state['initial_search_done'] = True
|
@@ -396,11 +396,11 @@ def main():
|
|
396 |
|
397 |
col1, col2 = st.columns(2)
|
398 |
with col1:
|
399 |
-
if st.button("ποΈ Start New Recording"):
|
400 |
st.session_state['recording'] = True
|
401 |
st.experimental_rerun()
|
402 |
with col2:
|
403 |
-
if st.button("π Stop Recording"):
|
404 |
st.session_state['recording'] = False
|
405 |
st.experimental_rerun()
|
406 |
|
@@ -409,7 +409,7 @@ def main():
|
|
409 |
new_val = voice_component(my_input_value="Recording...")
|
410 |
if new_val:
|
411 |
st.text_area("Recorded Text:", value=new_val, height=100)
|
412 |
-
if st.button("π Search with Recording"):
|
413 |
with st.spinner("Processing recording..."):
|
414 |
df = search.load_page()
|
415 |
results = search.quick_search(new_val, df)
|
@@ -443,14 +443,14 @@ def main():
|
|
443 |
"en-GB-TonyNeural"
|
444 |
],
|
445 |
index=0,
|
446 |
-
key="
|
447 |
)
|
448 |
|
449 |
st.write("Search Settings:")
|
450 |
-
st.slider("Minimum Search Score:", 0.0, 1.0, MIN_SEARCH_SCORE, 0.1)
|
451 |
-
st.slider("Exact Match Boost:", 1.0, 3.0, EXACT_MATCH_BOOST, 0.1)
|
452 |
|
453 |
-
if st.button("ποΈ Clear Search History"):
|
454 |
st.session_state['search_history'] = []
|
455 |
st.success("Search history cleared!")
|
456 |
st.experimental_rerun()
|
|
|
337 |
if audio_file:
|
338 |
play_and_download_audio(audio_file)
|
339 |
|
340 |
+
elif st.button("π Search", key="voice_input_search"):
|
341 |
st.session_state['old_val'] = voice_text
|
342 |
with st.spinner("Processing..."):
|
343 |
results = search.quick_search(edited_input, search.load_page())
|
|
|
364 |
with col3:
|
365 |
num_results = st.slider("Max results:", 1, 100, 20)
|
366 |
with col4:
|
367 |
+
search_button = st.button("π Search", key="main_search_button")
|
368 |
|
369 |
if (search_button or not st.session_state['initial_search_done']) and query:
|
370 |
st.session_state['initial_search_done'] = True
|
|
|
396 |
|
397 |
col1, col2 = st.columns(2)
|
398 |
with col1:
|
399 |
+
if st.button("ποΈ Start New Recording", key="start_recording_button"):
|
400 |
st.session_state['recording'] = True
|
401 |
st.experimental_rerun()
|
402 |
with col2:
|
403 |
+
if st.button("π Stop Recording", key="stop_recording_button"):
|
404 |
st.session_state['recording'] = False
|
405 |
st.experimental_rerun()
|
406 |
|
|
|
409 |
new_val = voice_component(my_input_value="Recording...")
|
410 |
if new_val:
|
411 |
st.text_area("Recorded Text:", value=new_val, height=100)
|
412 |
+
if st.button("π Search with Recording", key="recording_search_button"):
|
413 |
with st.spinner("Processing recording..."):
|
414 |
df = search.load_page()
|
415 |
results = search.quick_search(new_val, df)
|
|
|
443 |
"en-GB-TonyNeural"
|
444 |
],
|
445 |
index=0,
|
446 |
+
key="default_voice_setting"
|
447 |
)
|
448 |
|
449 |
st.write("Search Settings:")
|
450 |
+
st.slider("Minimum Search Score:", 0.0, 1.0, MIN_SEARCH_SCORE, 0.1, key="min_search_score")
|
451 |
+
st.slider("Exact Match Boost:", 1.0, 3.0, EXACT_MATCH_BOOST, 0.1, key="exact_match_boost")
|
452 |
|
453 |
+
if st.button("ποΈ Clear Search History", key="clear_history_button"):
|
454 |
st.session_state['search_history'] = []
|
455 |
st.success("Search history cleared!")
|
456 |
st.experimental_rerun()
|