Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -686,7 +686,7 @@ def create_embeddings(chunks):
|
|
| 686 |
def retrieve_relevant_chunks(question, chunks, embeddings, top_k=3):
|
| 687 |
"""Retrieve most relevant chunks for a question"""
|
| 688 |
if embedding_model is None or embeddings is None:
|
| 689 |
-
return chunks[:3]
|
| 690 |
|
| 691 |
try:
|
| 692 |
question_embedding = embedding_model.encode([question], show_progress_bar=False)
|
|
|
|
| 686 |
def retrieve_relevant_chunks(question, chunks, embeddings, top_k=3):
|
| 687 |
"""Retrieve most relevant chunks for a question"""
|
| 688 |
if embedding_model is None or embeddings is None:
|
| 689 |
+
return chunks[:3] # Fallback to first 3 chunks
|
| 690 |
|
| 691 |
try:
|
| 692 |
question_embedding = embedding_model.encode([question], show_progress_bar=False)
|