Spaces:
Sleeping
Sleeping
cd@bziiit.com
commited on
Commit
·
c9febc6
1
Parent(s):
415e2c4
feat: Improve UI and functionality across multiple components
Browse files- Update README title to "Conseiller Augmenté"
- Add unique key generation for model selector to prevent Streamlit rendering issues
- Increase text area height for system prompts in chapter parameters
- Commented out custom file uploader CSS for potential future localization
- README.md +1 -1
- model/selector.py +3 -1
- pages/chapter_params.py +1 -2
- pages/documents.py +21 -1
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🏢
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: indigo
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Conseiller Augmenté
|
| 3 |
emoji: 🏢
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: indigo
|
model/selector.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from .ModelIntegrations import ModelManager
|
| 3 |
|
| 4 |
def ModelSelector():
|
|
@@ -34,7 +35,8 @@ def ModelSelector():
|
|
| 34 |
model_mapping[option_name] = model_instance
|
| 35 |
|
| 36 |
# Sélection d'un modèle via un seul sélecteur
|
| 37 |
-
|
|
|
|
| 38 |
|
| 39 |
if(st.session_state["assistant"]):
|
| 40 |
splitter = model_mapping[selected_model_option].split(".")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import uuid
|
| 3 |
from .ModelIntegrations import ModelManager
|
| 4 |
|
| 5 |
def ModelSelector():
|
|
|
|
| 35 |
model_mapping[option_name] = model_instance
|
| 36 |
|
| 37 |
# Sélection d'un modèle via un seul sélecteur
|
| 38 |
+
unique_key = str(uuid.uuid4())
|
| 39 |
+
selected_model_option = st.selectbox("Choisissez votre modèle", options=model_options, key=unique_key)
|
| 40 |
|
| 41 |
if(st.session_state["assistant"]):
|
| 42 |
splitter = model_mapping[selected_model_option].split(".")
|
pages/chapter_params.py
CHANGED
|
@@ -7,7 +7,6 @@ def page():
|
|
| 7 |
# Charge la configuration YAML
|
| 8 |
config = getYamlConfig()
|
| 9 |
|
| 10 |
-
|
| 11 |
parts = config["chapters"]
|
| 12 |
parts_sorted = sorted(parts, key=lambda part: part.get('num', float('inf')))
|
| 13 |
|
|
@@ -15,7 +14,7 @@ def page():
|
|
| 15 |
tabs = st.tabs([part['name'] for part in parts_sorted])
|
| 16 |
for part, tab in zip(parts_sorted, tabs):
|
| 17 |
with tab:
|
| 18 |
-
st.text_area("Prompt System", part['prompt_system'])
|
| 19 |
|
| 20 |
|
| 21 |
page()
|
|
|
|
| 7 |
# Charge la configuration YAML
|
| 8 |
config = getYamlConfig()
|
| 9 |
|
|
|
|
| 10 |
parts = config["chapters"]
|
| 11 |
parts_sorted = sorted(parts, key=lambda part: part.get('num', float('inf')))
|
| 12 |
|
|
|
|
| 14 |
tabs = st.tabs([part['name'] for part in parts_sorted])
|
| 15 |
for part, tab in zip(parts_sorted, tabs):
|
| 16 |
with tab:
|
| 17 |
+
st.text_area("Prompt System", part['prompt_system'], height=400)
|
| 18 |
|
| 19 |
|
| 20 |
page()
|
pages/documents.py
CHANGED
|
@@ -20,8 +20,28 @@ def read_and_save_file():
|
|
| 20 |
def page():
|
| 21 |
st.subheader("Charger vos documents")
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# File uploader
|
| 24 |
-
|
| 25 |
"Télécharger un ou plusieurs documents",
|
| 26 |
type=["pdf"],
|
| 27 |
key="file_uploader",
|
|
|
|
| 20 |
def page():
|
| 21 |
st.subheader("Charger vos documents")
|
| 22 |
|
| 23 |
+
# Custom CSS to hide default English labels
|
| 24 |
+
# st.markdown(
|
| 25 |
+
# """
|
| 26 |
+
# <style>
|
| 27 |
+
# div[data-testid="stFileUploaderDropzoneInstructions"] div::before {
|
| 28 |
+
# content: "Déposer les fichiers ici ou cliquer pour parcourir";
|
| 29 |
+
# display: block;
|
| 30 |
+
# font-size: 14px;
|
| 31 |
+
# color: #333;
|
| 32 |
+
# text-align: center;
|
| 33 |
+
# padding: 10px;
|
| 34 |
+
# }
|
| 35 |
+
# div[data-testid="stFileUploaderDropzone"] div[role="button"] span {
|
| 36 |
+
# display: none !important;
|
| 37 |
+
# }
|
| 38 |
+
# </style>
|
| 39 |
+
# """,
|
| 40 |
+
# unsafe_allow_html=True
|
| 41 |
+
# )
|
| 42 |
+
|
| 43 |
# File uploader
|
| 44 |
+
st.file_uploader(
|
| 45 |
"Télécharger un ou plusieurs documents",
|
| 46 |
type=["pdf"],
|
| 47 |
key="file_uploader",
|