Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -201,32 +201,32 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue")) as demo:
|
|
| 201 |
outputs = []
|
| 202 |
|
| 203 |
with gr.Row():
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
|
| 224 |
|
| 225 |
examples = gr.Examples(
|
| 226 |
examples = [
|
| 227 |
["Black velvet blazer"],
|
| 228 |
["Pink blazer with buttons"]
|
| 229 |
-
],
|
| 230 |
inputs=[input_box]
|
| 231 |
)
|
| 232 |
|
|
|
|
| 201 |
outputs = []
|
| 202 |
|
| 203 |
with gr.Row():
|
| 204 |
+
for i in range(2): # Only 2 images
|
| 205 |
+
with gr.Column():
|
| 206 |
+
img = gr.Image(width=180, height=180, label=f"Design {i+1}")
|
| 207 |
+
image_components.append(img)
|
| 208 |
+
|
| 209 |
+
file_path = gr.Textbox(visible=False)
|
| 210 |
+
file_paths.append(file_path)
|
| 211 |
+
|
| 212 |
+
save_btn = gr.Button("💾 Save to DB")
|
| 213 |
+
save_buttons.append(save_btn)
|
| 214 |
+
|
| 215 |
+
output = gr.Textbox(label="Status", interactive=False)
|
| 216 |
+
outputs.append(output)
|
| 217 |
+
|
| 218 |
+
save_btn.click(
|
| 219 |
+
fn=send_to_backend,
|
| 220 |
+
inputs=[file_path, user_id_state],
|
| 221 |
+
outputs=output
|
| 222 |
+
)
|
| 223 |
|
| 224 |
|
| 225 |
examples = gr.Examples(
|
| 226 |
examples = [
|
| 227 |
["Black velvet blazer"],
|
| 228 |
["Pink blazer with buttons"]
|
| 229 |
+
],
|
| 230 |
inputs=[input_box]
|
| 231 |
)
|
| 232 |
|