Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -166,6 +166,10 @@ add_paper_buttons_and_links()
|
|
| 166 |
|
| 167 |
# Process user input is a post processor algorithm which runs after document embedding vector DB play of GPT on context of documents..
|
| 168 |
def process_user_input(user_question):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
response = st.session_state.conversation({'question': user_question})
|
| 170 |
st.session_state.chat_history = response['chat_history']
|
| 171 |
|
|
|
|
| 166 |
|
| 167 |
# Process user input is a post processor algorithm which runs after document embedding vector DB play of GPT on context of documents..
|
| 168 |
def process_user_input(user_question):
|
| 169 |
+
# Check and initialize 'conversation' in session state if not present
|
| 170 |
+
if 'conversation' not in st.session_state:
|
| 171 |
+
st.session_state.conversation = {} # Initialize with an empty dictionary or an appropriate default value
|
| 172 |
+
|
| 173 |
response = st.session_state.conversation({'question': user_question})
|
| 174 |
st.session_state.chat_history = response['chat_history']
|
| 175 |
|