mehradans92 commited on
Commit
4128cf7
·
1 Parent(s): a63b5cf

fixed progress bar

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -190,9 +190,9 @@ if searchButton:
190
  def answer_callback(question_query):
191
  global docs
192
  # global pdf_info
193
- my_bar = st.progress(0, text='Please wait...')
194
  if docs is None:
195
- my_bar.progress(0.2, text='Please wait...')
196
  pdf_info = st.session_state['pdf_info']
197
  print('buliding docs')
198
  docs = paperqa.Docs()
@@ -206,7 +206,7 @@ def answer_callback(question_query):
206
  # docs._build_faiss_index()
207
  answer = docs.query(question_query)
208
  # print(answer.formatted_answer)
209
- my_bar.progress(1.0, text='Done!')
210
  return answer.formatted_answer
211
 
212
 
@@ -217,7 +217,7 @@ question_query = form.text_input("What do you wanna know from these papers?", pl
217
  submitButton = form.form_submit_button('Submit')
218
 
219
  if submitButton:
220
- text = st.text_area("Answer:", answer_callback(question_query), height=600)
221
 
222
  # with st.form(key='question_form', clear_on_submit = False):
223
  # question_query = st.text_input("What do you wanna know from these papers?", placeholder='Input questions here')
 
190
  def answer_callback(question_query):
191
  global docs
192
  # global pdf_info
193
+ my_bar = st.progress(0, 'Please wait...')
194
  if docs is None:
195
+ my_bar.progress(0.2, 'Please wait...')
196
  pdf_info = st.session_state['pdf_info']
197
  print('buliding docs')
198
  docs = paperqa.Docs()
 
206
  # docs._build_faiss_index()
207
  answer = docs.query(question_query)
208
  # print(answer.formatted_answer)
209
+ my_bar.progress(1.0, 'Done!')
210
  return answer.formatted_answer
211
 
212
 
 
217
  submitButton = form.form_submit_button('Submit')
218
 
219
  if submitButton:
220
+ st.text_area("Answer:", answer_callback(question_query), height=600)
221
 
222
  # with st.form(key='question_form', clear_on_submit = False):
223
  # question_query = st.text_input("What do you wanna know from these papers?", placeholder='Input questions here')