-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Debug du cache et mise en place d'un TTL de 30 minutes #172
Conversation
ArtixJP
commented
Jan 22, 2025
- Correction du fonctionnement du cache pour éviter les erreurs de récupération des données et leur non mise à jour.
- Ajout d'une expiration automatique des données mises en cache (TTL fixé à 30 minutes).
- Correction du fonctionnement du cache pour éviter les erreurs de récupération des données et leur non mise à jour. - Ajout d'une expiration automatique des données mises en cache (TTL fixé à 30 minutes).
ui/config.py
Outdated
@@ -7,6 +7,7 @@ | |||
RERANK_MODEL_TYPE = "text-classification" | |||
INTERNET_COLLECTION_DISPLAY_ID = "internet" | |||
PRIVATE_COLLECTION_TYPE = "private" | |||
DUREE_CACHE_EN_SECONDES = 1800 # 30 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pas de francais dans le code
@@ -84,7 +89,9 @@ def get_models(api_key: str) -> tuple[str, str, str]: | |||
return language_models, embeddings_models, audio_models, rerank_models | |||
|
|||
|
|||
@st.cache_data(show_spinner="Retrieving data...") | |||
# Collections | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
espace en trop, il faut appliqué le linter
ui/utils.py
Outdated
@@ -170,11 +135,15 @@ def upload_file(api_key: str, file, collection_id: str) -> None: | |||
|
|||
if response.status_code == 201: | |||
st.toast("Upload succeed", icon="✅") | |||
#clear cache | |||
get_collections.clear(api_key) #since the number of documents in the collection has changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application du linter
ui/utils.py
Outdated
else: | ||
st.toast("Upload failed", icon="❌") | ||
|
||
|
||
@st.cache_data(show_spinner="Retrieving data...") | ||
#ttl = x, persistence de x secondes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas de code commenter dans le code
- Fixed cache retrieval issues to prevent outdated or incorrect data. - Implemented automatic cache refresh with a 30-minute time-to-live (TTL).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.