cogcorp commited on
Commit
17d4b41
·
1 Parent(s): e705c33

Update app.py

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