Update app.py
Browse files
app.py
CHANGED
@@ -46,8 +46,9 @@ def predict(message):
|
|
46 |
st.write("Done...")
|
47 |
|
48 |
st.write("Checking images...")
|
49 |
-
|
50 |
-
|
|
|
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 |
-
|
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 |
-
|
|
|
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']})
|