ProfessorLeVesseur commited on
Commit
ea594f1
·
verified ·
1 Parent(s): 27255d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -13,8 +13,8 @@ st.title("MTSS Snapshot: Accessibility Image Textifier: `Alt Text`")
13
  # Retrieve the OpenAI API key from Streamlit secrets and set it
14
  openai.api_key = st.secrets["openai_api_key"]
15
 
16
- # Set the OpenAI API key for the client
17
- openai.api_key = api_key
18
 
19
  # File uploader for images
20
  uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
@@ -37,7 +37,8 @@ if show_details:
37
  analyze_button = st.button("Analyse the MTSS Image")
38
 
39
  # Check if an image has been uploaded, if the API key is available, and if the button has been pressed
40
- if uploaded_file is not None and api_key and analyze_button:
 
41
 
42
  with st.spinner("Analysing the image ..."):
43
  # Encode the image
 
13
  # Retrieve the OpenAI API key from Streamlit secrets and set it
14
  openai.api_key = st.secrets["openai_api_key"]
15
 
16
+ # # Set the OpenAI API key for the client
17
+ # openai.api_key = api_key
18
 
19
  # File uploader for images
20
  uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
 
37
  analyze_button = st.button("Analyse the MTSS Image")
38
 
39
  # Check if an image has been uploaded, if the API key is available, and if the button has been pressed
40
+ # if uploaded_file is not None and api_key and analyze_button:
41
+ if uploaded_file is not None and analyze_button:
42
 
43
  with st.spinner("Analysing the image ..."):
44
  # Encode the image