Spaces:
Sleeping
Sleeping
update chunking strategy
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ with open("knowledge.txt", "r", encoding="utf-8") as f:
|
|
| 12 |
knowledge_text = f.read()
|
| 13 |
|
| 14 |
# Split the text into chunks (for example, by paragraphs)
|
| 15 |
-
chunks = [chunk.strip() for chunk in knowledge_text.split("\n
|
| 16 |
|
| 17 |
# Load an embedding model (this one is light and fast)
|
| 18 |
embedder = SentenceTransformer('all-MiniLM-L6-v2')
|
|
|
|
| 12 |
knowledge_text = f.read()
|
| 13 |
|
| 14 |
# Split the text into chunks (for example, by paragraphs)
|
| 15 |
+
chunks = [chunk.strip() for chunk in knowledge_text.split("\n") if chunk.strip()]
|
| 16 |
|
| 17 |
# Load an embedding model (this one is light and fast)
|
| 18 |
embedder = SentenceTransformer('all-MiniLM-L6-v2')
|