Trabis commited on
Commit
548a3a4
·
verified ·
1 Parent(s): 6d8f0ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -11,6 +11,7 @@ from typing import List, Optional, Union
11
  from llama_index.embeddings.huggingface import HuggingFaceInferenceAPIEmbedding
12
  # from llama_index.embeddings.huggingface import HuggingFaceEmbedding
13
  import streamlit as st
 
14
  import pickle
15
  import os
16
 
@@ -96,7 +97,8 @@ class QASystem:
96
 
97
 
98
  # Utilisation de singleton pour éviter les réinitialisations multiples
99
- @st.cache_resource
 
100
  def get_qa_system():
101
  return QASystem()
102
 
 
11
  from llama_index.embeddings.huggingface import HuggingFaceInferenceAPIEmbedding
12
  # from llama_index.embeddings.huggingface import HuggingFaceEmbedding
13
  import streamlit as st
14
+ from functools import lru_cache
15
  import pickle
16
  import os
17
 
 
97
 
98
 
99
  # Utilisation de singleton pour éviter les réinitialisations multiples
100
+ # @st.cache_resource
101
+ @lru_cache(maxsize=1000)
102
  def get_qa_system():
103
  return QASystem()
104