sourize commited on
Commit
2a82939
·
1 Parent(s): 06b2acd

Updated main.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -40,8 +40,8 @@ def chunk_text(text, chunk_size=500, overlap=50):
40
 
41
  # Build FAISS index from chunks
42
  @st.cache_resource
43
- def build_faiss_index(chunks, embedder):
44
- embeddings = embedder.encode(chunks)
45
  dim = embeddings.shape[1]
46
  index = faiss.IndexFlatL2(dim)
47
  index.add(embeddings)
 
40
 
41
  # Build FAISS index from chunks
42
  @st.cache_resource
43
+ def build_faiss_index(chunks, _embedder): # underscore to avoid hashing issues
44
+ embeddings = _embedder.encode(chunks)
45
  dim = embeddings.shape[1]
46
  index = faiss.IndexFlatL2(dim)
47
  index.add(embeddings)