suriya7 commited on
Commit
cc123a1
1 Parent(s): 75b1f48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -103,9 +103,9 @@ with st.sidebar:
103
  st.success("Done")
104
 
105
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
106
- if user_prompt:
107
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
108
- with st.chat_message("user", avatar="⛷️"):
109
  st.write(user_prompt)
110
  # response = handle_query(user_prompt)
111
  # st.session_state.messages.append({'role': 'assistant', "content": response})
@@ -116,7 +116,7 @@ if user_prompt:
116
 
117
  # Generate a new response if last message is not from assistant
118
  if st.session_state.messages[-1]["role"] != "assistant":
119
- with st.chat_message("assistant"):
120
  response = handle_query(user_prompt)
121
  full_response = st.write_stream(response)
122
  message = {"role": "assistant", "content": full_response}
 
103
  st.success("Done")
104
 
105
  user_prompt = st.chat_input("Ask me anything about the content of the PDF:")
106
+ if user_prompt and uploaded_file:
107
  st.session_state.messages.append({'role': 'user', "content": user_prompt})
108
+ with st.chat_message("user", avatar="👽"):
109
  st.write(user_prompt)
110
  # response = handle_query(user_prompt)
111
  # st.session_state.messages.append({'role': 'assistant', "content": response})
 
116
 
117
  # Generate a new response if last message is not from assistant
118
  if st.session_state.messages[-1]["role"] != "assistant":
119
+ with st.chat_message("assistant",avatar="./assistant.jpeg"):
120
  response = handle_query(user_prompt)
121
  full_response = st.write_stream(response)
122
  message = {"role": "assistant", "content": full_response}