Spaces:
Running
Running
Commit
·
b59d9ea
1
Parent(s):
49da7fe
Update app.py
Browse files
app.py
CHANGED
|
@@ -126,7 +126,15 @@ def generate_answer(question, openAI_key):
|
|
| 126 |
prompt += 'search results:\n\n'
|
| 127 |
for c in topn_chunks:
|
| 128 |
prompt += c + '\n\n'
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
|
| 132 |
prompt += f"Query: {question}\nAnswer:"
|
|
|
|
| 126 |
prompt += 'search results:\n\n'
|
| 127 |
for c in topn_chunks:
|
| 128 |
prompt += c + '\n\n'
|
| 129 |
+
|
| 130 |
+
prompt += "Instructions: Compose a comprehensive reply to the query using the search results given. Cite each reference "\
|
| 131 |
+
"using [Page Number] notation (every result has this number at the beginning). Citation should be done at the "\
|
| 132 |
+
"end of each sentence. If the search results mention multiple subjects with the same name, create separate "\
|
| 133 |
+
"answers for each. Only include information found in the results and don't add any additional information. "\
|
| 134 |
+
"Make sure the answer is correct and don't output false content. If the text does not relate to the query, "\
|
| 135 |
+
"simply state 'Text Not Found in PDF'. Ignore outlier search results which has nothing to do with the question. "\
|
| 136 |
+
"Only answer what is asked. The answer should be short and concise. Answer step-by-step.\n\nQuery: {question}"\
|
| 137 |
+
"\nAnswer: "
|
| 138 |
|
| 139 |
|
| 140 |
prompt += f"Query: {question}\nAnswer:"
|