mikepastor11 commited on
Commit
a446da1
1 Parent(s): adc7a83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -105,7 +105,12 @@ def process_user_question(user_question):
105
  if st == None :
106
  print('session is null')
107
  return
108
-
 
 
 
 
 
109
  response = st.session_state.conversation({'question': user_question})
110
  # response = st.session_state.conversation({'summarization': user_question})
111
  st.session_state.chat_history = response['chat_history']
@@ -124,6 +129,7 @@ def process_user_question(user_question):
124
  ###################################################################################
125
  def main():
126
 
 
127
  load_dotenv()
128
 
129
  ##################################################################################
@@ -143,7 +149,7 @@ def main():
143
  encoded_string = base64.b64encode(f.read()).decode()
144
 
145
  # Set page config with base64 string
146
- st.set_page_config(page_title="Pennwick PDF Analyzer 2", page_icon=f"data:image/ico;base64,{encoded_string}")
147
 
148
 
149
 
@@ -158,7 +164,7 @@ def main():
158
  st.session_state.chat_history = None
159
 
160
  # st.header("Pennwick File Analyzer :books:")
161
- st.header("Pennwick File Analyzer ")
162
 
163
  user_question = st.text_input("Ask the Model a question about your uploaded documents:")
164
  if user_question:
 
105
  if st == None :
106
  print('session is null')
107
  return
108
+
109
+ if st.session_state == None :
110
+ print('session STATE is null')
111
+ return
112
+
113
+
114
  response = st.session_state.conversation({'question': user_question})
115
  # response = st.session_state.conversation({'summarization': user_question})
116
  st.session_state.chat_history = response['chat_history']
 
129
  ###################################################################################
130
  def main():
131
 
132
+ # Load the environment variables - if any
133
  load_dotenv()
134
 
135
  ##################################################################################
 
149
  encoded_string = base64.b64encode(f.read()).decode()
150
 
151
  # Set page config with base64 string
152
+ st.set_page_config(page_title="Pennwick File Analyzer 2", page_icon=f"data:image/ico;base64,{encoded_string}")
153
 
154
 
155
 
 
164
  st.session_state.chat_history = None
165
 
166
  # st.header("Pennwick File Analyzer :books:")
167
+ st.header("Pennwick File Analyzer 2")
168
 
169
  user_question = st.text_input("Ask the Model a question about your uploaded documents:")
170
  if user_question: