ProfessorLeVesseur commited on
Commit
7964be8
·
verified ·
1 Parent(s): 506b62a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -146,7 +146,8 @@ def encode_image(image_file):
146
  return base64.b64encode(image_file.getvalue()).decode("utf-8")
147
 
148
  # Streamlit page setup
149
- st.set_page_config(page_title="MTSS Image Accessibility Alt Text Generator", layout="centered", initial_sidebar_state="collapsed")
 
150
 
151
  #Add the image with a specified width
152
  image_width = 300 # Set the desired width in pixels
@@ -162,7 +163,8 @@ openai.api_key = st.secrets["openai_api_key"]
162
  # File uploader allows user to add their own image
163
  # uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
164
 
165
- st.write("Please open the sidebar to upload an image.")
 
166
 
167
  # Move the file uploader to the sidebar
168
  uploaded_file = st.sidebar.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
 
146
  return base64.b64encode(image_file.getvalue()).decode("utf-8")
147
 
148
  # Streamlit page setup
149
+ st.set_page_config(page_title="MTSS Image Accessibility Alt Text Generator", layout="centered", initial_sidebar_state="auto")
150
+ # initial_sidebar_state ("auto" or "expanded" or "collapsed")
151
 
152
  #Add the image with a specified width
153
  image_width = 300 # Set the desired width in pixels
 
163
  # File uploader allows user to add their own image
164
  # uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
165
 
166
+ st.write("Please upload an image in the sidebar.")
167
+ st.markdown("<span style='color:green; font-weight:bold;'>Please upload an image in the sidebar.</span>", unsafe_allow_html=True)
168
 
169
  # Move the file uploader to the sidebar
170
  uploaded_file = st.sidebar.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])