Spaces:
Runtime error
Runtime error
Changes to GPT3 prompt
Browse files
app.py
CHANGED
@@ -122,15 +122,16 @@ def generate_answer(question):
|
|
122 |
for c in topn_chunks:
|
123 |
prompt += c + '\n\n'
|
124 |
|
125 |
-
prompt += "Instructions: Compose a comprehensive reply to the query using the search results given."\
|
126 |
-
"Cite each reference using [number] notation (every result has this number at the beginning)."\
|
127 |
-
"Citation should be done at the end of each sentence. If the search results mention multiple subjects"\
|
128 |
-
"with the same name, create separate answers for each. Only include information found in the results and"\
|
129 |
-
"don't add any additional information. Make sure the answer is correct and don't output false content."\
|
130 |
-
"If the text does not relate to the query, simply state 'Found Nothing'.
|
131 |
-
"
|
|
|
132 |
|
133 |
-
prompt += f"Query: {question}\
|
134 |
answer = generate_text(prompt)
|
135 |
return answer
|
136 |
|
|
|
122 |
for c in topn_chunks:
|
123 |
prompt += c + '\n\n'
|
124 |
|
125 |
+
prompt += "Instructions: Compose a comprehensive reply to the query using the search results given. "\
|
126 |
+
"Cite each reference using [number] notation (every result has this number at the beginning). "\
|
127 |
+
"Citation should be done at the end of each sentence. If the search results mention multiple subjects "\
|
128 |
+
"with the same name, create separate answers for each. Only include information found in the results and "\
|
129 |
+
"don't add any additional information. Make sure the answer is correct and don't output false content. "\
|
130 |
+
"If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
|
131 |
+
"search results which has nothing to do with the question. Only answer what is asked. The "\
|
132 |
+
"answer should be short and concise.\n\nQuery: {question}\nAnswer: "
|
133 |
|
134 |
+
prompt += f"Query: {question}\nAnswer:"
|
135 |
answer = generate_text(prompt)
|
136 |
return answer
|
137 |
|