Illia56 commited on
Commit
8348fe5
Β·
1 Parent(s): 6743734

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -46,8 +46,9 @@ def predict(message):
46
  st.write("Done...")
47
 
48
  st.write("Checking images...")
49
- for i in response['images']:
50
- st.image(i)
 
51
 
52
  return response
53
 
@@ -62,7 +63,7 @@ for message in st.session_state.messages:
62
  # React to user input
63
  if prompt := st.chat_input("Ask Palm 2 anything..."):
64
  st.chat_message("human", avatar="πŸ§‘β€πŸ’»").markdown(prompt)
65
- # st.session_state.messages.append({"role": "human", "content": prompt})
66
 
67
  response = predict(prompt)
68
  with st.chat_message("assistant", avatar='🌴'):
@@ -82,4 +83,4 @@ if prompt := st.chat_input("Ask Palm 2 anything..."):
82
  except Exception as e:
83
  st.write(f"ERROR {e}...")
84
 
85
- # st.session_state.messages.append({"role": "assistant", "content": response['content']})
 
46
  st.write("Done...")
47
 
48
  st.write("Checking images...")
49
+ if 'images' in response.keys():
50
+ for i in response['images']:
51
+ st.image(i)
52
 
53
  return response
54
 
 
63
  # React to user input
64
  if prompt := st.chat_input("Ask Palm 2 anything..."):
65
  st.chat_message("human", avatar="πŸ§‘β€πŸ’»").markdown(prompt)
66
+ st.session_state.messages.append({"role": "human", "content": prompt})
67
 
68
  response = predict(prompt)
69
  with st.chat_message("assistant", avatar='🌴'):
 
83
  except Exception as e:
84
  st.write(f"ERROR {e}...")
85
 
86
+ st.session_state.messages.append({"role": "assistant", "content": response['content']})