Spaces:
Sleeping
Sleeping
removing commented out cod
Browse files
rag_app/knowledge_base/build_vector_store.py
CHANGED
@@ -60,26 +60,3 @@ def build_vector_store(
|
|
60 |
result = f"built vectore store at {FAISS_INDEX_PATH}"
|
61 |
return result
|
62 |
|
63 |
-
|
64 |
-
# # Path for saving the FAISS index
|
65 |
-
# FAISS_INDEX_PATH = "./vectorstore/lc-faiss-multi-mpnet-500"
|
66 |
-
|
67 |
-
# try:
|
68 |
-
# # Stage two: Vectorization of the document chunks
|
69 |
-
# model_name = "sentence-transformers/multi-qa-mpnet-base-dot-v1" # Model used for embedding
|
70 |
-
|
71 |
-
# # Initialize HuggingFace embeddings with the specified model
|
72 |
-
# embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
73 |
-
|
74 |
-
# print(f'Loading chunks into vector store ...')
|
75 |
-
# st = time.time() # Start time for performance measurement
|
76 |
-
# # Create a FAISS vector store from the document chunks and save it locally
|
77 |
-
# db = FAISS.from_documents(filter_complex_metadata(chunks), embeddings)
|
78 |
-
# db.save_local(FAISS_INDEX_PATH)
|
79 |
-
# et = time.time() - st # Calculate time taken for vectorization
|
80 |
-
# print(f'Time taken for vectorization and saving: {et} seconds.')
|
81 |
-
# except Exception as e:
|
82 |
-
# print(f"Error during vectorization or FAISS index saving: {e}", file=sys.stderr)
|
83 |
-
|
84 |
-
# alternatively download a preparaed vectorized index from S3 and load the index into vectorstore
|
85 |
-
# Import necessary libraries for AWS S3 interaction, file handling, and FAISS vector stores
|
|
|
60 |
result = f"built vectore store at {FAISS_INDEX_PATH}"
|
61 |
return result
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|