joshuadunlop commited on
Commit
039bca9
·
1 Parent(s): e9ba6d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -117,13 +117,14 @@ def generate_answer(question,openAI_key):
117
  for c in topn_chunks:
118
  prompt += c + '\n\n'
119
 
120
- prompt += "Instructions: Compose a simple reply to the query using the search results given. "
121
- "Citation should be done at the end of each sentence. If the search results mention multiple subjects "
122
- "with the same name, create separate answers for each. Only include information found in the results and "
123
- "don't add any additional information. Make sure the answer is correct and don't output false content. "
124
- "If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "
125
- "search results which has nothing to do with the question. Only answer what is asked. The "
126
- "answer should be short and concise. \n\nQuery: {question}\nAnswer:"
 
127
 
128
  prompt += f"Query: {question}\nAnswer:"
129
  answer = generate_text(openAI_key, prompt,"text-davinci-003")
 
117
  for c in topn_chunks:
118
  prompt += c + '\n\n'
119
 
120
+ prompt += "Instructions: Compose a comprehensive reply to the query using the search results given. "\
121
+ "Cite each reference using [ Page Number] notation (every result has this number at the beginning). "\
122
+ "Citation should be done at the end of each sentence. If the search results mention multiple subjects "\
123
+ "with the same name, create separate answers for each. Only include information found in the results and "\
124
+ "don't add any additional information. Make sure the answer is correct and don't output false content. "\
125
+ "If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
126
+ "search results which has nothing to do with the question. Only answer what is asked. The "\
127
+ "answer should be short and concise. \n\nQuery: {question}\nAnswer: "
128
 
129
  prompt += f"Query: {question}\nAnswer:"
130
  answer = generate_text(openAI_key, prompt,"text-davinci-003")