piekenius123 commited on
Commit
cea4bf0
·
verified ·
1 Parent(s): d234139

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -238,16 +238,16 @@ def render_sample_view(df_filtered: pd.DataFrame, index: int):
238
  meta_raw = row.get("metadata", "")
239
  meta_raw = meta_raw if isinstance(meta_raw, str) else str(meta_raw)
240
 
241
- # Gallery (label, image)
242
  gallery_items = [
243
- ("Marked / Original", marked),
244
- ("Original", original),
245
- ("Solution", sol),
246
- ("Mask", mask),
247
- ("Cell map", cell_map),
248
  ]
249
  # remove None images
250
- gallery_items = [(t, img) for (t, img) in gallery_items if img is not None]
251
 
252
  status_md = f"**Sample** `{sid}` \n**Index** `{index}` / `{len(df_filtered)-1}`"
253
  return index, status_md, instruction, gallery_items, meta_json, meta_raw
 
238
  meta_raw = row.get("metadata", "")
239
  meta_raw = meta_raw if isinstance(meta_raw, str) else str(meta_raw)
240
 
241
+ # Gallery: Gradio expects (image, caption) per item
242
  gallery_items = [
243
+ (marked, "Marked / Original"),
244
+ (original, "Original"),
245
+ (sol, "Solution"),
246
+ (mask, "Mask"),
247
+ (cell_map, "Cell map"),
248
  ]
249
  # remove None images
250
+ gallery_items = [(img, cap) for (img, cap) in gallery_items if img is not None]
251
 
252
  status_md = f"**Sample** `{sid}` \n**Index** `{index}` / `{len(df_filtered)-1}`"
253
  return index, status_md, instruction, gallery_items, meta_json, meta_raw