Docfile commited on
Commit
5ae354b
·
verified ·
1 Parent(s): b16530f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -54,6 +54,9 @@ if "chat" not in st.session_state:
54
  # Display Form Title
55
  st.title("Mariam AI!")
56
 
 
 
 
57
  # Display chat messages from history above current input box
58
  for message in st.session_state.chat.history:
59
  with st.chat_message(role_to_streamlit(message.role)):
@@ -64,9 +67,6 @@ if prompt := st.chat_input("Hey?"):
64
  # Display user's last message
65
  st.chat_message("user").markdown(prompt)
66
 
67
- # Handle file uploads
68
- uploaded_file = st.file_uploader("Choose a file", type=["png", "jpg", "jpeg", "mp3", "wav", "mp4", "avi"])
69
-
70
  if uploaded_file is not None:
71
  # Display the uploaded file
72
  if uploaded_file.type.startswith('image'):
 
54
  # Display Form Title
55
  st.title("Mariam AI!")
56
 
57
+ # Handle file uploads outside the input loop
58
+ uploaded_file = st.file_uploader("Choose a file", type=["png", "jpg", "jpeg", "mp3", "wav", "mp4", "avi"])
59
+
60
  # Display chat messages from history above current input box
61
  for message in st.session_state.chat.history:
62
  with st.chat_message(role_to_streamlit(message.role)):
 
67
  # Display user's last message
68
  st.chat_message("user").markdown(prompt)
69
 
 
 
 
70
  if uploaded_file is not None:
71
  # Display the uploaded file
72
  if uploaded_file.type.startswith('image'):