Spaces:
Runtime error
Runtime error
Anonymous Authors
commited on
Commit
·
3d21eb0
1
Parent(s):
50ee128
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def get_nearest(adjective, profession, model, no):
|
|
36 |
neighbors = ds.select(range(max(ix-10, 0), min(ix+10, len(ds)-1)))
|
37 |
neighbor_images = neighbors["image"]
|
38 |
neighbor_captions = [caption.split("/")[-1] for caption in neighbors["image_path"]]
|
39 |
-
neighbor_captions = [' '.join(caption.split("_")[4:-3]) for caption in neighbor_captions]
|
40 |
neighbor_models = neighbors["model"]
|
41 |
neighbor_captions = [f"{a} {b}" for a,b in zip(neighbor_captions,neighbor_models)]
|
42 |
return image, list(zip(neighbor_images, neighbor_captions))
|
|
|
36 |
neighbors = ds.select(range(max(ix-10, 0), min(ix+10, len(ds)-1)))
|
37 |
neighbor_images = neighbors["image"]
|
38 |
neighbor_captions = [caption.split("/")[-1] for caption in neighbors["image_path"]]
|
39 |
+
# neighbor_captions = [' '.join(caption.split("_")[4:-3]) for caption in neighbor_captions]
|
40 |
neighbor_models = neighbors["model"]
|
41 |
neighbor_captions = [f"{a} {b}" for a,b in zip(neighbor_captions,neighbor_models)]
|
42 |
return image, list(zip(neighbor_images, neighbor_captions))
|