Spaces:
Runtime error
Runtime error
Commit
·
a410275
1
Parent(s):
ae378cc
commit
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def func(index):
|
|
24 |
|
25 |
|
26 |
def add_outputs_for_key(example, outputs, target_size, item):
|
27 |
-
for item_key in [f'{item}_image', f'{item}
|
28 |
if item_key == f'comments_{item}':
|
29 |
outputs.append(get_empty_comment_if_needed(example[item_key]))
|
30 |
elif item_key == f'{item}_image':
|
@@ -48,9 +48,9 @@ def add_column_by_key(item, target_size):
|
|
48 |
i1 = gr.Image(value=img_resized, label=f'{item.capitalize()} Image')
|
49 |
p1 = gr.Textbox(value=wmtis[index][f"{item}_image_caption"], label='BLIP2 Predicted Caption')
|
50 |
r1 = gr.Textbox(value=wmtis[index][f"rating_{item}"], label='Rating')
|
51 |
-
t1 = gr.Textbox(value=wmtis[index][f"{item}_hash"], label='Image ID')
|
52 |
c1 = gr.Textbox(value=get_empty_comment_if_needed(wmtis[index][f"comments_{item}"]), label='Comments')
|
53 |
-
|
|
|
54 |
return item_outputs
|
55 |
|
56 |
|
|
|
24 |
|
25 |
|
26 |
def add_outputs_for_key(example, outputs, target_size, item):
|
27 |
+
for item_key in [f'{item}_image', f'{item}_image_caption', f'rating_{item}', f'comments_{item}', f'{item}_hash']:
|
28 |
if item_key == f'comments_{item}':
|
29 |
outputs.append(get_empty_comment_if_needed(example[item_key]))
|
30 |
elif item_key == f'{item}_image':
|
|
|
48 |
i1 = gr.Image(value=img_resized, label=f'{item.capitalize()} Image')
|
49 |
p1 = gr.Textbox(value=wmtis[index][f"{item}_image_caption"], label='BLIP2 Predicted Caption')
|
50 |
r1 = gr.Textbox(value=wmtis[index][f"rating_{item}"], label='Rating')
|
|
|
51 |
c1 = gr.Textbox(value=get_empty_comment_if_needed(wmtis[index][f"comments_{item}"]), label='Comments')
|
52 |
+
t1 = gr.Textbox(value=wmtis[index][f"{item}_hash"], label='Image ID')
|
53 |
+
item_outputs = [i1, p1, r1, c1, t1]
|
54 |
return item_outputs
|
55 |
|
56 |
|