rick commited on
Commit
7b4db18
·
unverified ·
1 Parent(s): c21f366

... not done...

Browse files
Files changed (1) hide show
  1. pages/main.py +29 -4
pages/main.py CHANGED
@@ -473,9 +473,34 @@ def init_process_mode(
473
 
474
 
475
  @st.dialog("Settings")
476
- def vote(item):
477
- st.write(f"Why is {item} your favorite?")
478
- reason = st.text_input("Because...")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  if st.button("Submit"):
480
  st.session_state.vote = {"item": item, "reason": reason}
481
  st.rerun()
@@ -634,7 +659,7 @@ def main_page():
634
 
635
  if "autoplay_tts" not in st.session_state:
636
  st.session_state["autoplay_tts"] = False
637
-
638
  if "enable_tts_for_input_from_text_field" not in st.session_state:
639
  st.session_state["enable_tts_for_input_from_text_field"] = False
640
 
 
473
 
474
 
475
  @st.dialog("Settings")
476
+ def vote(name__tts_voice,
477
+ state__tts_with_text,
478
+ state__tts_with_audio,
479
+ state__autoplay_tts):
480
+ with st.expander(f"{get_translation('parametres_tts')}",
481
+ expanded=True,
482
+ icon="🔊"):
483
+ set__tts_voice = st.selectbox(
484
+ get_translation("choix_voix_tts"),
485
+ options=["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
486
+ index=3
487
+ )
488
+ set__tts_with_text = st.checkbox(
489
+ get_translation("activer_tts_texte"),
490
+ key="enable_tts_for_input_from_text_field",
491
+ value=state__tts_with_text
492
+ )
493
+ set__tts_with_audio = st.checkbox(
494
+ get_translation("activer_tts_audio"),
495
+ key="enable_tts_for_input_from_audio_record",
496
+ value=state__tts_with_audio
497
+ )
498
+ set__autoplay_tts = st.checkbox(
499
+ get_translation("lecture_auto_tts"),
500
+ key="autoplay_tts",
501
+ value=state__autoplay_tts
502
+ )
503
+
504
  if st.button("Submit"):
505
  st.session_state.vote = {"item": item, "reason": reason}
506
  st.rerun()
 
659
 
660
  if "autoplay_tts" not in st.session_state:
661
  st.session_state["autoplay_tts"] = False
662
+
663
  if "enable_tts_for_input_from_text_field" not in st.session_state:
664
  st.session_state["enable_tts_for_input_from_text_field"] = False
665