Update web_demo_streamlit-2_5.py

Fixed a bug where imagefile was not initialized when no image was passed in
This commit is contained in:
JamePeng
2024-08-18 23:53:07 +08:00
committed by GitHub
parent 0e4ec319cf
commit 259d54ed0a

View File

@@ -88,6 +88,7 @@ if user_text:
# Generate reply using the model # Generate reply using the model
model = st.session_state.model model = st.session_state.model
tokenizer = st.session_state.tokenizer tokenizer = st.session_state.tokenizer
imagefile = None
with st.chat_message(A_NAME, avatar="assistant"): with st.chat_message(A_NAME, avatar="assistant"):
# If the previous message contains an image, pass the image to the model # If the previous message contains an image, pass the image to the model