Spaces:
Running
Running
Update app.py
Browse files
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"
|