Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -91,7 +91,15 @@ with gr.Blocks() as demo:
|
|
91 |
|
92 |
# Event handlers
|
93 |
generate_button.click(predict, [image, model_choice, max_tokens, temperature], caption)
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
|
97 |
demo.launch()
|
|
|
91 |
|
92 |
# Event handlers
|
93 |
generate_button.click(predict, [image, model_choice, max_tokens, temperature], caption)
|
94 |
+
|
95 |
+
# Create an event handler for the entire Dataframe
|
96 |
+
def dataframe_selected(index, row, model_choice):
|
97 |
+
if row is not None: # Check if an actual row was selected
|
98 |
+
return predict_from_table(row, model_choice)
|
99 |
+
|
100 |
+
# Attach the function to the dataframe
|
101 |
+
image_table.change(dataframe_selected, inputs=[image_table, model_choice], outputs=[image_display, caption])
|
102 |
+
|
103 |
|
104 |
|
105 |
demo.launch()
|