Spaces:
Sleeping
Sleeping
Commit
·
6ddf79a
1
Parent(s):
64b006f
UPDATE: format docs
Browse files- config.ini +2 -2
- src/components/rag/RAG.py +7 -1
config.ini
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[EMBEDDINGS]
|
2 |
embeddingModel = BAAI/bge-large-en-v1.5
|
3 |
-
device =
|
4 |
normalize_embeddings = true
|
5 |
|
6 |
[VECTORSTORE]
|
@@ -22,4 +22,4 @@ fetchK = 10
|
|
22 |
timeout = 30
|
23 |
|
24 |
[EASYOCR]
|
25 |
-
gpu =
|
|
|
1 |
[EMBEDDINGS]
|
2 |
embeddingModel = BAAI/bge-large-en-v1.5
|
3 |
+
device = cpu
|
4 |
normalize_embeddings = true
|
5 |
|
6 |
[VECTORSTORE]
|
|
|
22 |
timeout = 30
|
23 |
|
24 |
[EASYOCR]
|
25 |
+
gpu = false
|
src/components/rag/RAG.py
CHANGED
@@ -25,7 +25,13 @@ class Chain:
|
|
25 |
Returns:
|
26 |
str: Formatted string with documents or a placeholder if empty.
|
27 |
"""
|
28 |
-
context = "
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
return context
|
30 |
|
31 |
def returnChain(self, text: str):
|
|
|
25 |
Returns:
|
26 |
str: Formatted string with documents or a placeholder if empty.
|
27 |
"""
|
28 |
+
context = ""
|
29 |
+
for doc in docs:
|
30 |
+
context += f"{doc}\n\n\n"
|
31 |
+
if context == "":
|
32 |
+
context = "No Context Found"
|
33 |
+
else:
|
34 |
+
pass
|
35 |
return context
|
36 |
|
37 |
def returnChain(self, text: str):
|