Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -150,16 +150,15 @@ with chat_col:
|
|
150 |
with st.chat_message(msg["role"]):
|
151 |
st.markdown(msg["content"], unsafe_allow_html=True)
|
152 |
|
153 |
-
# ------------------ Image Preview ------------------
|
154 |
with image_col:
|
155 |
if show_image and st.session_state.image_urls:
|
156 |
st.markdown("### 🖼️ Slide Previews")
|
157 |
for raw_url in st.session_state.image_urls:
|
158 |
try:
|
159 |
-
|
160 |
-
r = requests.get(raw_url)
|
161 |
r.raise_for_status()
|
162 |
img = Image.open(BytesIO(r.content))
|
163 |
st.image(img, caption=f"📷 {raw_url.split('/')[-1]}", use_container_width=True)
|
164 |
-
except Exception
|
165 |
-
|
|
|
150 |
with st.chat_message(msg["role"]):
|
151 |
st.markdown(msg["content"], unsafe_allow_html=True)
|
152 |
|
153 |
+
# ------------------ Image Preview (Silent Fails) ------------------
|
154 |
with image_col:
|
155 |
if show_image and st.session_state.image_urls:
|
156 |
st.markdown("### 🖼️ Slide Previews")
|
157 |
for raw_url in st.session_state.image_urls:
|
158 |
try:
|
159 |
+
r = requests.get(raw_url, timeout=5)
|
|
|
160 |
r.raise_for_status()
|
161 |
img = Image.open(BytesIO(r.content))
|
162 |
st.image(img, caption=f"📷 {raw_url.split('/')[-1]}", use_container_width=True)
|
163 |
+
except Exception:
|
164 |
+
continue # Silently skip broken images
|