Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -429,8 +429,7 @@ def load_main_data_source():
|
|
| 429 |
# Split main content into chunks
|
| 430 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 431 |
chunk_size=2000, # Adjust based on your model's context limit
|
| 432 |
-
chunk_overlap=200
|
| 433 |
-
separators=["\n\n", "\n", ".", " "]
|
| 434 |
)
|
| 435 |
main_texts = text_splitter.split_text(main_content)
|
| 436 |
|
|
@@ -1107,7 +1106,6 @@ def rag_response(query):
|
|
| 1107 |
Context:
|
| 1108 |
{context}
|
| 1109 |
|
| 1110 |
-
You are an expert assistant tasked with generating precise and accurate answers based only on the provided context. Follow these strict rules:
|
| 1111 |
1. Use only the provided context to generate your answer.
|
| 1112 |
2. Match headings and content exactly as they appear in the knowledge base. Do not add, modify, or generalize content.
|
| 1113 |
|
|
|
|
| 429 |
# Split main content into chunks
|
| 430 |
text_splitter = RecursiveCharacterTextSplitter(
|
| 431 |
chunk_size=2000, # Adjust based on your model's context limit
|
| 432 |
+
chunk_overlap=200 # Ensures continuity between chunks
|
|
|
|
| 433 |
)
|
| 434 |
main_texts = text_splitter.split_text(main_content)
|
| 435 |
|
|
|
|
| 1106 |
Context:
|
| 1107 |
{context}
|
| 1108 |
|
|
|
|
| 1109 |
1. Use only the provided context to generate your answer.
|
| 1110 |
2. Match headings and content exactly as they appear in the knowledge base. Do not add, modify, or generalize content.
|
| 1111 |
|