Skip to content

Commit

Permalink
add image viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Jul 26, 2024
1 parent 4bbf542 commit 8e62a55
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/chat/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@ def main():
if st.button(file.name):
st.session_state.file_path = file

if (
"file_path" in st.session_state
and st.session_state.file_path is not None
and st.session_state.file_path.suffix
in (
".jpg",
".jpeg",
".png",
".bmp",
".webp",
)
):
st.image(
str(WORKSPACE / st.session_state.file_path), use_column_width=True
)

with tabs[1]:
if (
"file_path" not in st.session_state
Expand Down

0 comments on commit 8e62a55

Please sign in to comment.