Update src/qa.py
Browse files
src/qa.py
CHANGED
|
@@ -295,7 +295,7 @@ def generate_answer(query: str, retrieved_chunks: list, reasoning_mode: bool = F
|
|
| 295 |
return "⚠️ GPT-4o not initialized. Check credentials or rebuild the Space."
|
| 296 |
|
| 297 |
# Build and clean context
|
| 298 |
-
context = "\n".join(
|
| 299 |
context = "\n".join(dict.fromkeys(context.splitlines()))
|
| 300 |
context = truncate_context(context, 100000)
|
| 301 |
|
|
|
|
| 295 |
return "⚠️ GPT-4o not initialized. Check credentials or rebuild the Space."
|
| 296 |
|
| 297 |
# Build and clean context
|
| 298 |
+
context = "\n".join(chunk.strip() for chunk in retrieved_chunks)
|
| 299 |
context = "\n".join(dict.fromkeys(context.splitlines()))
|
| 300 |
context = truncate_context(context, 100000)
|
| 301 |
|