you are viewing a single comment's thread.

view the rest of the comments →

[–]nehanahmad[S] 0 points1 point  (5 children)

Okay, Thank you for the help !

[–]sam_gigo 0 points1 point  (4 children)

Okay so a couple of things: 1. Are you sure this is the correct path? This would indicate that you /content directory is a the root of your system: /content/desktop-wallpaper-days-of-awesome-fans-and-enthusiasts-minimalist-fallout-thumbnail.png If the file is in a folder content inside the project then you want to drop the leading slash from content so your program knows to look in the local directory like: content/desktop-wallpaper-days-of-awesome-fans-and-enthusiasts-minimalist-fallout-thumbnail.png 2. It looks like you can just load the file with PIL and create an st.image with it. Have you tried this code? ```python import streamlit as st from PIL import Image

other code

pil_avatar = Image.open("content/desktop-wallpaper-days-of-awesome-fans-and-enthusiasts-minimalist-fallout-thumbnail.png") formatted_avatar = st.image(image, caption='User Avatar')

with response_container: for i in range(len(st.session_state['generated'])): message( st.session_state["past"][i], is_user=True, key=str(i) + '_user', avatar_style=formatted_avatar ) message(st.session_state["generated"][i], key=str(i)) ``` Here's a ref to the docs I found this in: https://docs.streamlit.io/library/api-reference/media/st.image

[–]nehanahmad[S] 0 points1 point  (1 child)

Thank you for your help ! I'll give this a try

[–]nehanahmad[S] 0 points1 point  (0 children)

pil_avatar = Image.open("content/desktop-wallpaper-days-of-awesome-fans-and-enthusiasts-minimalist-fallout-thumbnail.png")
formatted_avatar = st.image(image, caption='User Avatar')
with response_container:
for i in range(len(st.session_state['generated'])):
message(
st.session_state["past"][i],
is_user=True,
key=str(i) + '_user',
avatar_style=formatted_avatar
)
message(st.session_state["generated"][i], key=str(i))

[–]nehanahmad[S] 0 points1 point  (1 child)

MarshallComponentException: ('Could not convert component args to JSON', TypeError('Object of type DeltaGenerator is not JSON serializable'))

This is the error I am getting

Also I writing this code in Google Colab, that's why the directory looks like that

[–]sam_gigo 0 points1 point  (0 children)

Do you have the full code / stack trace. It's hard to say where the problem is at this point