mikepastor11 commited on
Commit
01f7fae
1 Parent(s): 26ae716

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -9
app.py CHANGED
@@ -110,10 +110,10 @@ def process_user_question(user_question):
110
 
111
  print('process_user_question called: \n')
112
 
113
- if not SESSION_STARTED:
114
- print('No Session')
115
- st.write( 'Please upload and analyze your PDF files first!')
116
- return
117
 
118
  if user_question == None :
119
  print('question is null')
@@ -130,14 +130,21 @@ def process_user_question(user_question):
130
 
131
  print('question is: ', user_question)
132
  print('\nsession is: ', st )
133
-
134
- response = st.session_state.conversation({'question': user_question})
135
- # response = st.session_state.conversation({'summarization': user_question})
136
- st.session_state.chat_history = response['chat_history']
 
 
 
 
137
 
138
  # st.empty()
139
 
140
- results_size = len( response['chat_history'] )
 
 
 
141
  results_string = ""
142
 
143
  print('results_size is: ', results_size )
 
110
 
111
  print('process_user_question called: \n')
112
 
113
+ # if not SESSION_STARTED:
114
+ # print('No Session')
115
+ # st.write( 'Please upload and analyze your PDF files first!')
116
+ # return
117
 
118
  if user_question == None :
119
  print('question is null')
 
130
 
131
  print('question is: ', user_question)
132
  print('\nsession is: ', st )
133
+
134
+ # try:
135
+ # response = st.session_state.conversation({'question': user_question})
136
+ # # response = st.session_state.conversation({'summarization': user_question})
137
+ # st.session_state.chat_history = response['chat_history']
138
+ # Exception:
139
+ # st.write( 'Please upload and analyze your PDF files first!')
140
+ # return
141
 
142
  # st.empty()
143
 
144
+ response = st.session_state.conversation({'question': user_question})
145
+ st.session_state.chat_history = response['chat_history']
146
+ results_size = len(response['chat_history'])
147
+
148
  results_string = ""
149
 
150
  print('results_size is: ', results_size )