Skip to content
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

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

ArtixJP
Copy link
Contributor

@ArtixJP 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).
@ArtixJP ArtixJP requested a review from leoguillaume January 22, 2025 10:04
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
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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).
@ArtixJP ArtixJP requested a review from leoguillaume January 22, 2025 11:03
Copy link
Contributor

@leoguillaume leoguillaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@leoguillaume leoguillaume merged commit 23ba125 into main Jan 22, 2025
2 checks passed
@leoguillaume leoguillaume deleted the feat/ui-debug branch January 22, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants