IAMTFRMZA commited on
Commit
ade236f
ยท
verified ยท
1 Parent(s): 9dd3863

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -62,6 +62,13 @@ if "pending_prompt" not in st.session_state:
62
  tab1, tab2 = st.tabs(["๐Ÿ’ฌ Chat Assistant", "๐Ÿ–ผ๏ธ Visual Reference Search"])
63
 
64
  # ------------------ Tab 1 ------------------
 
 
 
 
 
 
 
65
  with tab1:
66
  with st.sidebar:
67
  st.header("๐Ÿ”ง Tools")
@@ -160,7 +167,7 @@ with tab1:
160
  st.image(img, caption="๐Ÿ“„ Referenced Image", use_container_width=True)
161
  except Exception as e:
162
  st.error(f"๐Ÿ–ผ๏ธ Failed to load image: {e}")
163
-
164
  # ------------------ Tab 2: Visual Reference Search ------------------
165
  with tab2:
166
  ASSISTANT_ID = "asst_9v09zgizdcuuhNdcFQpRo9RO"
 
62
  tab1, tab2 = st.tabs(["๐Ÿ’ฌ Chat Assistant", "๐Ÿ–ผ๏ธ Visual Reference Search"])
63
 
64
  # ------------------ Tab 1 ------------------
65
+
66
+ # โœ… Ensure required keys exist
67
+ if "image_url" not in st.session_state:
68
+ st.session_state.image_url = None
69
+ if "image_updated" not in st.session_state:
70
+ st.session_state.image_updated = False
71
+
72
  with tab1:
73
  with st.sidebar:
74
  st.header("๐Ÿ”ง Tools")
 
167
  st.image(img, caption="๐Ÿ“„ Referenced Image", use_container_width=True)
168
  except Exception as e:
169
  st.error(f"๐Ÿ–ผ๏ธ Failed to load image: {e}")
170
+
171
  # ------------------ Tab 2: Visual Reference Search ------------------
172
  with tab2:
173
  ASSISTANT_ID = "asst_9v09zgizdcuuhNdcFQpRo9RO"