Spaces:
Sleeping
Sleeping
Update chatbot_rag.py
Browse files- chatbot_rag.py +3 -1
chatbot_rag.py
CHANGED
|
@@ -95,7 +95,9 @@ def build_qa():
|
|
| 95 |
|
| 96 |
# 6. Helper functions
|
| 97 |
def format_docs(docs):
|
| 98 |
-
|
|
|
|
|
|
|
| 99 |
|
| 100 |
def hf_to_str(x):
|
| 101 |
"""Convert Hugging Face pipeline output to clean plain text."""
|
|
|
|
| 95 |
|
| 96 |
# 6. Helper functions
|
| 97 |
def format_docs(docs):
|
| 98 |
+
# ✅ skip any docs where page_content is None
|
| 99 |
+
return "\n".join(d.page_content for d in docs if d.page_content)
|
| 100 |
+
|
| 101 |
|
| 102 |
def hf_to_str(x):
|
| 103 |
"""Convert Hugging Face pipeline output to clean plain text."""
|