joshuadunlop commited on
Commit
e1c5134
·
1 Parent(s): 853fad2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -115,7 +115,7 @@ def generate_answer(question,openAI_key):
115
  "don't add any additional information. Make sure the answer is correct and don't output false content. "\
116
  "If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
117
  "search results which has nothing to do with the question. Only answer what is asked. The "\
118
- "answer should be short and concise. \n\nQuery: {question}\nAnswer: "
119
 
120
  prompt += f"Query: {question}\nAnswer:"
121
  answer = generate_text(openAI_key, prompt,"text-davinci-003")
@@ -138,8 +138,8 @@ with col1:
138
  with col2:
139
  question = st.text_input('Question')
140
  with col3:
141
- answer_placeholder = st.empty() # Create an empty placeholder for the 'Answer' box
142
- answer_placeholder.text_area('Answer', value='', height=40) # Initialize the 'Answer' box with an empty string
143
  with col4:
144
  if st.button('Submit'):
145
  if openAI_key.strip()=='':
@@ -154,4 +154,4 @@ with col4:
154
  load_recommender('corpus.pdf')
155
 
156
  answer = generate_answer(question,openAI_key)
157
- answer_placeholder.text_area('Answer', value=answer, height=40) # Fill in the 'Answer' box with the generated answer
 
115
  "don't add any additional information. Make sure the answer is correct and don't output false content. "\
116
  "If the text does not relate to the query, simply state 'Found Nothing'. Ignore outlier "\
117
  "search results which has nothing to do with the question. Only answer what is asked. The "\
118
+ "answer should be short and concise. \n\nQuery: {question}\nAnswer:"
119
 
120
  prompt += f"Query: {question}\nAnswer:"
121
  answer = generate_text(openAI_key, prompt,"text-davinci-003")
 
138
  with col2:
139
  question = st.text_input('Question')
140
  with col3:
141
+ answer_placeholder = st.empty()
142
+ answer_placeholder.text_area('Answer', value='')
143
  with col4:
144
  if st.button('Submit'):
145
  if openAI_key.strip()=='':
 
154
  load_recommender('corpus.pdf')
155
 
156
  answer = generate_answer(question,openAI_key)
157
+ answer_placeholder.text_area('Answer', value=answer)