Exception has occurred: StreamlitAPIException
Failed to load the provided avatar value as an image.
TypeError: a bytes-like object is required, not ‘DeltaGenerator’
The above exception was the direct cause of the following exception:
File "<absolute_path_folder>/strimlit.py", line 33, in <module>
with st.chat_message(name='assistant', avatar=st.image(logo_path)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
streamlit.errors.StreamlitAPIException: Failed to load the provided avatar value as an image.
below my code:
from PIL import Image
logo_path = "../../images/logo.png"
image = Image.open(logo_path)
...
if st.session_state.messages[-1]["role"] != "assistant":
with st.chat_message(name='assistant', avatar=st.image(image=image)):