Stefano Fiorucci commited on
Commit
b8ea4bc
·
unverified ·
1 Parent(s): 500db4e

try to better manage cache

Browse files
Files changed (1) hide show
  1. app_utils/backend_utils.py +2 -2
app_utils/backend_utils.py CHANGED
@@ -18,7 +18,7 @@ from app_utils.config import (
18
  )
19
 
20
 
21
- @st.experimental_memo
22
  def load_statements():
23
  """Load statements from file"""
24
  with open(STATEMENTS_PATH) as fin:
@@ -66,7 +66,7 @@ pipe, prompt_node = start_haystack()
66
 
67
  # the pipeline is not included as parameter of the following function,
68
  # because it is difficult to cache
69
- @st.experimental_memo #(allow_output_mutation=True)
70
  def check_statement(statement: str, retriever_top_k: int = 5):
71
  """Run query and verify statement"""
72
  params = {"retriever": {"top_k": retriever_top_k}}
 
18
  )
19
 
20
 
21
+ @st.cache()
22
  def load_statements():
23
  """Load statements from file"""
24
  with open(STATEMENTS_PATH) as fin:
 
66
 
67
  # the pipeline is not included as parameter of the following function,
68
  # because it is difficult to cache
69
+ @st.cache(allow_output_mutation=True, ttl=36000)
70
  def check_statement(statement: str, retriever_top_k: int = 5):
71
  """Run query and verify statement"""
72
  params = {"retriever": {"top_k": retriever_top_k}}