Spaces:
Paused
Paused
rick
commited on
start work day
Browse files- pages/main.py +15 -8
pages/main.py
CHANGED
|
@@ -473,7 +473,7 @@ def init_process_mode(
|
|
| 473 |
|
| 474 |
|
| 475 |
@st.dialog("Settings")
|
| 476 |
-
def
|
| 477 |
state__tts_with_text,
|
| 478 |
state__tts_with_audio,
|
| 479 |
state__autoplay_tts):
|
|
@@ -483,26 +483,27 @@ def vote(name__tts_voice,
|
|
| 483 |
set__tts_voice = st.selectbox(
|
| 484 |
get_translation("choix_voix_tts"),
|
| 485 |
options=["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
|
| 486 |
-
index=
|
| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 506 |
st.rerun()
|
| 507 |
|
| 508 |
|
|
@@ -686,8 +687,14 @@ def main_page():
|
|
| 686 |
st.logo("img/logo_2.png", icon_image="img/logo_2.png")
|
| 687 |
st.header(get_translation("sidebar_titre"))
|
| 688 |
|
| 689 |
-
|
| 690 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 691 |
|
| 692 |
with st.expander(f"{get_translation('a_propos')}",
|
| 693 |
expanded=False,
|
|
|
|
| 473 |
|
| 474 |
|
| 475 |
@st.dialog("Settings")
|
| 476 |
+
def tts_settings(name__tts_voice,
|
| 477 |
state__tts_with_text,
|
| 478 |
state__tts_with_audio,
|
| 479 |
state__autoplay_tts):
|
|
|
|
| 483 |
set__tts_voice = st.selectbox(
|
| 484 |
get_translation("choix_voix_tts"),
|
| 485 |
options=["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
|
| 486 |
+
index=list(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]).index(name__tts_voice)
|
| 487 |
)
|
| 488 |
set__tts_with_text = st.checkbox(
|
| 489 |
get_translation("activer_tts_texte"),
|
|
|
|
| 490 |
value=state__tts_with_text
|
| 491 |
)
|
| 492 |
set__tts_with_audio = st.checkbox(
|
| 493 |
get_translation("activer_tts_audio"),
|
|
|
|
| 494 |
value=state__tts_with_audio
|
| 495 |
)
|
| 496 |
set__autoplay_tts = st.checkbox(
|
| 497 |
get_translation("lecture_auto_tts"),
|
|
|
|
| 498 |
value=state__autoplay_tts
|
| 499 |
)
|
| 500 |
|
| 501 |
if st.button("Submit"):
|
| 502 |
+
st.session_state.autoplay_tts = set__autoplay_tts
|
| 503 |
+
st.session_state.enable_tts_for_input_from_audio_record = set__tts_with_audio
|
| 504 |
+
st.session_state.enable_tts_for_input_from_text_field = set__tts_with_text
|
| 505 |
+
st.session_state.tts_voice = set__tts_voice
|
| 506 |
+
#st.session_state.
|
| 507 |
st.rerun()
|
| 508 |
|
| 509 |
|
|
|
|
| 687 |
st.logo("img/logo_2.png", icon_image="img/logo_2.png")
|
| 688 |
st.header(get_translation("sidebar_titre"))
|
| 689 |
|
| 690 |
+
st.write(f"#### Settings")
|
| 691 |
+
if st.button(f"Text-To-Speech"):
|
| 692 |
+
tts_settings(
|
| 693 |
+
name__tts_voice = st.session_state.tts_voice,
|
| 694 |
+
state__tts_with_text = st.session_state.enable_tts_for_input_from_text_field,
|
| 695 |
+
state__tts_with_audio = st.session_state.enable_tts_for_input_from_audio_record,
|
| 696 |
+
state__autoplay_tts = st.session_state.autoplay_tts
|
| 697 |
+
)
|
| 698 |
|
| 699 |
with st.expander(f"{get_translation('a_propos')}",
|
| 700 |
expanded=False,
|