agnprz commited on
Commit
5030a87
·
verified ·
1 Parent(s): 873d90f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +7 -1
src/streamlit_app.py CHANGED
@@ -61,7 +61,13 @@ for idx, row in filtered_df.iterrows():
61
 
62
  with c1:
63
  # Load Image
64
- img_path = row.get("web_image_path", "")
 
 
 
 
 
 
65
  if os.path.exists(img_path):
66
  img = Image.open(img_path)
67
  st.image(img, use_container_width=True, caption=f"Token: {row['token'][:8]}...")
 
61
 
62
  with c1:
63
  # Load Image
64
+ raw_path = row.get("web_image_path", "")
65
+ # Fix path if it doesn't start with the folder name
66
+ if not raw_path.startswith("hf_demo_pack"):
67
+ img_path = os.path.join("hf_demo_pack", raw_path)
68
+ else:
69
+ img_path = raw_path
70
+
71
  if os.path.exists(img_path):
72
  img = Image.open(img_path)
73
  st.image(img, use_container_width=True, caption=f"Token: {row['token'][:8]}...")