Spaces:
Paused
Paused
Commit
·
8b9fad7
1
Parent(s):
440cc04
minors UX updates
Browse files- app.py +2 -2
- pages/configuration_ui_lang.py +2 -3
- pages/main.py +19 -3
- requirements.txt +1 -1
- var_app.py +1 -1
app.py
CHANGED
|
@@ -87,8 +87,8 @@ def main():
|
|
| 87 |
if 'interface_language' not in st.session_state:
|
| 88 |
# default language
|
| 89 |
st.session_state.interface_language = 'English'
|
| 90 |
-
|
| 91 |
-
|
| 92 |
pages = {
|
| 93 |
"Configuration" : [
|
| 94 |
st.Page("pages/configuration_ui_lang.py", title="Language selection"),
|
|
|
|
| 87 |
if 'interface_language' not in st.session_state:
|
| 88 |
# default language
|
| 89 |
st.session_state.interface_language = 'English'
|
| 90 |
+
|
| 91 |
+
|
| 92 |
pages = {
|
| 93 |
"Configuration" : [
|
| 94 |
st.Page("pages/configuration_ui_lang.py", title="Language selection"),
|
pages/configuration_ui_lang.py
CHANGED
|
@@ -72,11 +72,10 @@ def get_translation(key: str) -> str:
|
|
| 72 |
# Dictionary to store translations
|
| 73 |
translations = load_ui_language()
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
def language_selection_page():
|
| 79 |
st.set_page_config(initial_sidebar_state="collapsed")
|
|
|
|
|
|
|
| 80 |
# Fonction de rappel pour mettre à jour la langue temporaire lorsque la sélection change
|
| 81 |
def update_temp_language():
|
| 82 |
st.session_state['temp_interface_language'] = st.session_state['language_selector']
|
|
|
|
| 72 |
# Dictionary to store translations
|
| 73 |
translations = load_ui_language()
|
| 74 |
|
|
|
|
|
|
|
|
|
|
| 75 |
def language_selection_page():
|
| 76 |
st.set_page_config(initial_sidebar_state="collapsed")
|
| 77 |
+
st.set_page_config(page_icon="👹")
|
| 78 |
+
st.set_page_config(layout="wide")
|
| 79 |
# Fonction de rappel pour mettre à jour la langue temporaire lorsque la sélection change
|
| 80 |
def update_temp_language():
|
| 81 |
st.session_state['temp_interface_language'] = st.session_state['language_selector']
|
pages/main.py
CHANGED
|
@@ -289,6 +289,15 @@ def recorder_released():
|
|
| 289 |
def main_page():
|
| 290 |
"""Page principale de l'application."""
|
| 291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
# Dictionnaire pour stocker les fichiers modifiés
|
| 293 |
if 'changed_uploaded_files' not in st.session_state:
|
| 294 |
st.session_state.changed_uploaded_files = {}
|
|
@@ -395,7 +404,8 @@ def main_page():
|
|
| 395 |
with st.container(border=True):
|
| 396 |
# Interface utilisateur pour le chat textuel
|
| 397 |
st.session_state.user_input = st.chat_input(
|
| 398 |
-
get_translation("entrez_message")
|
|
|
|
| 399 |
)
|
| 400 |
|
| 401 |
|
|
@@ -404,7 +414,8 @@ def main_page():
|
|
| 404 |
"Choose files to upload",
|
| 405 |
accept_multiple_files=True,
|
| 406 |
type=CHAT_FILES_UPLOAD_ALLOWED_TYPES,
|
| 407 |
-
key="chat_files_upload"
|
|
|
|
| 408 |
)
|
| 409 |
|
| 410 |
if st.session_state.uploaded_files is not None:
|
|
@@ -470,7 +481,12 @@ def main_page():
|
|
| 470 |
|
| 471 |
|
| 472 |
# Interface utilisateur pour l'enregistrement audio
|
| 473 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 474 |
|
| 475 |
if st.session_state.user_input:
|
| 476 |
# Appeler la fonction de modération
|
|
|
|
| 289 |
def main_page():
|
| 290 |
"""Page principale de l'application."""
|
| 291 |
|
| 292 |
+
if "ui_chat_input_disabled" not in st.session_state:
|
| 293 |
+
st.session_state.ui_chat_input_disabled = False
|
| 294 |
+
|
| 295 |
+
if "ui_audio_input_disabled" not in st.session_state:
|
| 296 |
+
st.session_state.ui_audio_input_disabled = False
|
| 297 |
+
|
| 298 |
+
if "ui_filesuploader_disabled" not in st.session_state:
|
| 299 |
+
st.session_state.ui_filesuploader_disabled = False
|
| 300 |
+
|
| 301 |
# Dictionnaire pour stocker les fichiers modifiés
|
| 302 |
if 'changed_uploaded_files' not in st.session_state:
|
| 303 |
st.session_state.changed_uploaded_files = {}
|
|
|
|
| 404 |
with st.container(border=True):
|
| 405 |
# Interface utilisateur pour le chat textuel
|
| 406 |
st.session_state.user_input = st.chat_input(
|
| 407 |
+
get_translation("entrez_message"),
|
| 408 |
+
disabled=st.session_state.ui_chat_input_disabled
|
| 409 |
)
|
| 410 |
|
| 411 |
|
|
|
|
| 414 |
"Choose files to upload",
|
| 415 |
accept_multiple_files=True,
|
| 416 |
type=CHAT_FILES_UPLOAD_ALLOWED_TYPES,
|
| 417 |
+
key="chat_files_upload",
|
| 418 |
+
disabled=st.session_state.ui_filesuploader_disabled
|
| 419 |
)
|
| 420 |
|
| 421 |
if st.session_state.uploaded_files is not None:
|
|
|
|
| 481 |
|
| 482 |
|
| 483 |
# Interface utilisateur pour l'enregistrement audio
|
| 484 |
+
st.audio_input(
|
| 485 |
+
"Record a voice message",
|
| 486 |
+
on_change=recorder_released,
|
| 487 |
+
key="rec_widget",
|
| 488 |
+
disabled=st.session_state.ui_audio_input_disabled
|
| 489 |
+
)
|
| 490 |
|
| 491 |
if st.session_state.user_input:
|
| 492 |
# Appeler la fonction de modération
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
streamlit==1.
|
| 2 |
openai
|
| 3 |
pydub
|
| 4 |
python-dotenv
|
|
|
|
| 1 |
+
streamlit==1.40.0
|
| 2 |
openai
|
| 3 |
pydub
|
| 4 |
python-dotenv
|
var_app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
__version__ = "1.3.
|
| 2 |
|
| 3 |
from core.files import read_file
|
| 4 |
|
|
|
|
| 1 |
+
__version__ = "1.3.8"
|
| 2 |
|
| 3 |
from core.files import read_file
|
| 4 |
|