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