Ajaykanth Maddi commited on
Commit ·
44211ab
1
Parent(s): 35cdb85
BM25 UI Changes
Browse files- app.py +1 -1
- ragbench.py +2 -2
app.py
CHANGED
|
@@ -226,7 +226,7 @@ def run_rag_pipeline(subset, question, custom_question, chunking, embed_model, r
|
|
| 226 |
|
| 227 |
# 3. Load or use stored vector DB
|
| 228 |
# rag.store_embeddings_database() # or
|
| 229 |
-
rag.load_embeddings_database()
|
| 230 |
print("Loaded the embeddings database - Complete")
|
| 231 |
|
| 232 |
# 4. Retrieve and Generate Answer
|
|
|
|
| 226 |
|
| 227 |
# 3. Load or use stored vector DB
|
| 228 |
# rag.store_embeddings_database() # or
|
| 229 |
+
rag.load_embeddings_database(retriever_type=retriever_type)
|
| 230 |
print("Loaded the embeddings database - Complete")
|
| 231 |
|
| 232 |
# 4. Retrieve and Generate Answer
|
ragbench.py
CHANGED
|
@@ -233,7 +233,7 @@ class RAGSystem:
|
|
| 233 |
|
| 234 |
return True
|
| 235 |
|
| 236 |
-
def load_embeddings_database(self):
|
| 237 |
print("Testing new changes in ragbench.py")
|
| 238 |
|
| 239 |
if self._check_huggingface_repo() is False:
|
|
@@ -271,7 +271,7 @@ class RAGSystem:
|
|
| 271 |
self._store_faiss_files(faissFolderPath)
|
| 272 |
|
| 273 |
|
| 274 |
-
if bChunkFileAvailable:
|
| 275 |
bm25 = BM25Retriever.from_documents(langchain_docs)
|
| 276 |
bm25.k = 20
|
| 277 |
|
|
|
|
| 233 |
|
| 234 |
return True
|
| 235 |
|
| 236 |
+
def load_embeddings_database(self, retriever_type = "Vector"):
|
| 237 |
print("Testing new changes in ragbench.py")
|
| 238 |
|
| 239 |
if self._check_huggingface_repo() is False:
|
|
|
|
| 271 |
self._store_faiss_files(faissFolderPath)
|
| 272 |
|
| 273 |
|
| 274 |
+
if bChunkFileAvailable and retriever_type == "BM25":
|
| 275 |
bm25 = BM25Retriever.from_documents(langchain_docs)
|
| 276 |
bm25.k = 20
|
| 277 |
|