Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -97,9 +97,9 @@ with gr.Blocks() as interface:
|
|
97 |
with gr.Row():
|
98 |
for card, url in valid_card_images.items():
|
99 |
with gr.Column():
|
100 |
-
# Combine the image and button
|
101 |
-
gr.Image(value=url,
|
102 |
-
gr.Button(card).click(
|
103 |
toggle_card,
|
104 |
inputs=[gr.Textbox(card), selected_deck],
|
105 |
outputs=[selected_deck],
|
@@ -115,4 +115,13 @@ with gr.Blocks() as interface:
|
|
115 |
predict_button = gr.Button("Make Prediction")
|
116 |
predict_button.click(validate_and_predict, inputs=[selected_deck], outputs=[result])
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
interface.launch()
|
|
|
97 |
with gr.Row():
|
98 |
for card, url in valid_card_images.items():
|
99 |
with gr.Column():
|
100 |
+
# Combine the image and button in a smaller size
|
101 |
+
gr.Image(value=url, interactive=False, elem_id=f"image-{card}") # Image display
|
102 |
+
gr.Button(card, elem_id=f"button-{card}").click(
|
103 |
toggle_card,
|
104 |
inputs=[gr.Textbox(card), selected_deck],
|
105 |
outputs=[selected_deck],
|
|
|
115 |
predict_button = gr.Button("Make Prediction")
|
116 |
predict_button.click(validate_and_predict, inputs=[selected_deck], outputs=[result])
|
117 |
|
118 |
+
# Add custom CSS to adjust the image size
|
119 |
+
interface.css = """
|
120 |
+
img {
|
121 |
+
width: 70px !important;
|
122 |
+
height: 70px !important;
|
123 |
+
margin-bottom: 5px;
|
124 |
+
}
|
125 |
+
"""
|
126 |
+
|
127 |
interface.launch()
|