Spaces:
Paused
Paused
Upload Index.py
Browse files
Index.py
CHANGED
@@ -248,4 +248,9 @@ def rag(domain: str, question: str):
|
|
248 |
# else:
|
249 |
print("before doing Q&A")
|
250 |
answer = _search(question, extractor)
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
248 |
# else:
|
249 |
print("before doing Q&A")
|
250 |
answer = _search(question, extractor)
|
251 |
+
|
252 |
+
text = _prompt(question)
|
253 |
+
text += "\n" + " ".join(x["text"] for x in embeddings.search(question))
|
254 |
+
print("context \n")
|
255 |
+
print(text)
|
256 |
+
return {"question": question, "answer": answer, "context": text}
|