Spaces:
Paused
Paused
rick
commited on
bug fixed now... not done...
Browse files- pages/main.py +1 -17
pages/main.py
CHANGED
|
@@ -579,10 +579,6 @@ def main_page():
|
|
| 579 |
if "messages" not in st.session_state:
|
| 580 |
st.session_state.messages = []
|
| 581 |
|
| 582 |
-
# Vérification de l'existence d'un message système dans st.session_state.messages
|
| 583 |
-
#if not any(message["role"] == "system" for message in st.session_state.messages):
|
| 584 |
-
# st.session_state.messages.insert(0, {"role": "system", "content": system_prompt})
|
| 585 |
-
|
| 586 |
# Interface utilisateur pour le chat textuel
|
| 587 |
if user_input := st.chat_input(get_translation("entrez_message")):
|
| 588 |
|
|
@@ -691,7 +687,7 @@ def main_page():
|
|
| 691 |
|
| 692 |
if 'operation_prompt' in locals():
|
| 693 |
del operation_prompt
|
| 694 |
-
|
| 695 |
if 'user_input' in locals():
|
| 696 |
del user_input
|
| 697 |
|
|
@@ -710,9 +706,6 @@ def main_page():
|
|
| 710 |
):
|
| 711 |
# Traitement de l'entrée audio de l'utilisateur
|
| 712 |
if len(audio) > 0:
|
| 713 |
-
#with st.status(get_translation("transcription_audio_en_cours"), expanded=False) as stt_status:
|
| 714 |
-
#try:
|
| 715 |
-
#stt_status.update(label=get_translation("transcription_audio_en_cours"), state="running", expanded=True)
|
| 716 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as temp_audio:
|
| 717 |
audio.export(temp_audio.name, format="wav")
|
| 718 |
st.write(f"Frame rate: {audio.frame_rate}, Frame width: {audio.frame_width}, Duration: {audio.duration_seconds} seconds")
|
|
@@ -768,7 +761,6 @@ def main_page():
|
|
| 768 |
pass
|
| 769 |
|
| 770 |
if audio_list:
|
| 771 |
-
#stt_status.update(label=f"{get_translation('concatenation_audio_en_cours')}", state="running", expanded=True)
|
| 772 |
final_audio = concatenate_audio_files(audio_list)
|
| 773 |
del audio_list
|
| 774 |
with st.container(border=True):
|
|
@@ -790,14 +782,6 @@ def main_page():
|
|
| 790 |
key=f"download_button_{langues}_{timestamp}",
|
| 791 |
)
|
| 792 |
|
| 793 |
-
#stt_status.update(label=f"{get_translation('concatenation_audio_terminee')}", state="complete", expanded=True)
|
| 794 |
-
#else:
|
| 795 |
-
#stt_status.update(label=f"{get_translation('erreur_concatenation_audio')}", state="error", expanded=True)
|
| 796 |
-
#except Exception as e:
|
| 797 |
-
# st.error(f"{get_translation('erreur_transcription_audio')} : {str(e)}")
|
| 798 |
-
# stt_status.update(label=f"{get_translation('erreur_transcription_audio')} : {str(e)}", state="error", expanded=True)
|
| 799 |
-
|
| 800 |
-
|
| 801 |
|
| 802 |
# Configuration de la barre latérale
|
| 803 |
with st.sidebar:
|
|
|
|
| 579 |
if "messages" not in st.session_state:
|
| 580 |
st.session_state.messages = []
|
| 581 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 582 |
# Interface utilisateur pour le chat textuel
|
| 583 |
if user_input := st.chat_input(get_translation("entrez_message")):
|
| 584 |
|
|
|
|
| 687 |
|
| 688 |
if 'operation_prompt' in locals():
|
| 689 |
del operation_prompt
|
| 690 |
+
|
| 691 |
if 'user_input' in locals():
|
| 692 |
del user_input
|
| 693 |
|
|
|
|
| 706 |
):
|
| 707 |
# Traitement de l'entrée audio de l'utilisateur
|
| 708 |
if len(audio) > 0:
|
|
|
|
|
|
|
|
|
|
| 709 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as temp_audio:
|
| 710 |
audio.export(temp_audio.name, format="wav")
|
| 711 |
st.write(f"Frame rate: {audio.frame_rate}, Frame width: {audio.frame_width}, Duration: {audio.duration_seconds} seconds")
|
|
|
|
| 761 |
pass
|
| 762 |
|
| 763 |
if audio_list:
|
|
|
|
| 764 |
final_audio = concatenate_audio_files(audio_list)
|
| 765 |
del audio_list
|
| 766 |
with st.container(border=True):
|
|
|
|
| 782 |
key=f"download_button_{langues}_{timestamp}",
|
| 783 |
)
|
| 784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 785 |
|
| 786 |
# Configuration de la barre latérale
|
| 787 |
with st.sidebar:
|