John Graham Reynolds commited on
Commit
6b9eb29
·
1 Parent(s): 4abddf8

update deocrator on fn that returns embedding model

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -81,7 +81,7 @@ def get_system_prompt():
81
  # make sure we cache this so that it doesnt redownload each time, hindering Space start time if sleeping
82
  # try adding this st caching decorator to ensure the embeddings class gets cached after downloading the entirety of the model
83
  # does this cache to the given folder though? It does appear to populate the folder as expected after being run
84
- @st.cache_data # will this work here?
85
  def load_embedding_model():
86
  embeddings = HuggingFaceEmbeddings(model_name="BAAI/bge-large-en", cache_folder="./langchain_cache/")
87
  return embeddings
 
81
  # make sure we cache this so that it doesnt redownload each time, hindering Space start time if sleeping
82
  # try adding this st caching decorator to ensure the embeddings class gets cached after downloading the entirety of the model
83
  # does this cache to the given folder though? It does appear to populate the folder as expected after being run
84
+ @st.cache_resource # will this work here? https://docs.streamlit.io/develop/concepts/architecture/caching
85
  def load_embedding_model():
86
  embeddings = HuggingFaceEmbeddings(model_name="BAAI/bge-large-en", cache_folder="./langchain_cache/")
87
  return embeddings