Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ class PDFChatbot:
|
|
20 |
|
21 |
def get_relevant_context(self, user_question: str) -> List[str]:
|
22 |
"""Split text into smaller chunks for better processing."""
|
23 |
-
db = FAISS.load_local('mbaldb', HuggingFaceEmbeddings(model_name='bkai-foundation-models/vietnamese-bi-encoder')
|
24 |
relevant_chunks = db.similarity_search(user_question, k=3)
|
25 |
relevant_chunks = [chunk.page_content for chunk in relevant_chunks]
|
26 |
return "\n\n".join(relevant_chunks)
|
|
|
20 |
|
21 |
def get_relevant_context(self, user_question: str) -> List[str]:
|
22 |
"""Split text into smaller chunks for better processing."""
|
23 |
+
db = FAISS.load_local('mbaldb', HuggingFaceEmbeddings(model_name='bkai-foundation-models/vietnamese-bi-encoder'))
|
24 |
relevant_chunks = db.similarity_search(user_question, k=3)
|
25 |
relevant_chunks = [chunk.page_content for chunk in relevant_chunks]
|
26 |
return "\n\n".join(relevant_chunks)
|