joshuadunlop commited on
Commit
3b1c212
·
1 Parent(s): c4d5b35

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -121,8 +121,8 @@ def generate_answer(question,openAI_key):
121
  st.error('The recommender is not fitted yet.')
122
  return
123
 
124
- # Replace the hard-coded string with the variable prompt
125
- prompt += f"Query: {question}\nAnswer: "
126
  answer = generate_text(openAI_key, prompt,"text-davinci-003")
127
 
128
  answer = answer.strip()
@@ -155,7 +155,7 @@ with the same name, create separate answers for each. Only include information f
155
  don't add any additional information. Make sure the answer is correct, and don't output false content.
156
  If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier
157
  search results that have nothing to do with the question. Only answer what is asked. The
158
- answer should be short and concise. \n\nQuery: {question}\nAnswer: """)
159
 
160
  if add_row:
161
  row_count += 1
 
121
  st.error('The recommender is not fitted yet.')
122
  return
123
 
124
+ # Replace the hard-coded string with the variable instructions
125
+ prompt = instructions + f"\n\nQuery: {question}\nAnswer: "
126
  answer = generate_text(openAI_key, prompt,"text-davinci-003")
127
 
128
  answer = answer.strip()
 
155
  don't add any additional information. Make sure the answer is correct, and don't output false content.
156
  If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier
157
  search results that have nothing to do with the question. Only answer what is asked. The
158
+ answer should be short and concise.""")
159
 
160
  if add_row:
161
  row_count += 1