joshuadunlop commited on
Commit
72d334e
·
1 Parent(s): 590eb55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -136,13 +136,13 @@ col1, col2, col3, col4 = st.columns(4)
136
  with col1:
137
  url = st.text_input('Enter PDF URL here')
138
  with col2:
139
- question = st.text_input('Enter your question here')
140
  with col3:
141
- answer = st.text_area('The answer to your question is :', value='', height=80)
142
  with col4:
143
  if st.button('Submit'):
144
  if openAI_key.strip()=='':
145
- st.error('Please enter you Open AI Key. Get your key here : https://platform.openai.com/account/api-keys')
146
  elif url.strip() == '':
147
  st.error('URL field is empty')
148
  elif question.strip() == '':
@@ -153,5 +153,4 @@ with col4:
153
  load_recommender('corpus.pdf')
154
 
155
  answer = generate_answer(question,openAI_key)
156
- # Update the answer text area
157
- col3.text_area('The answer to your question is :', value=answer, height=200)
 
136
  with col1:
137
  url = st.text_input('Enter PDF URL here')
138
  with col2:
139
+ question = st.text_input('Question')
140
  with col3:
141
+ answer_placeholder = st.empty()
142
  with col4:
143
  if st.button('Submit'):
144
  if openAI_key.strip()=='':
145
+ st.error('Please enter you Open AI Key')
146
  elif url.strip() == '':
147
  st.error('URL field is empty')
148
  elif question.strip() == '':
 
153
  load_recommender('corpus.pdf')
154
 
155
  answer = generate_answer(question,openAI_key)
156
+ answer_placeholder.text_area('The answer to your question is :', value=answer, height=200)