Update app.py
Browse files❌ Versi lama (error):
with gr.Row():
box = gr.Textbox(...)
copy_btn = gr.CopyButton(value=box) ← GA ADA DI GRADIO INI
✅ Versi sekarang (aman):
with gr.Group(visible=(i < 3)) as group:
box = gr.Textbox(...) ← cukup ini saja
app.py
CHANGED
|
@@ -363,23 +363,20 @@ with gr.Blocks() as demo:
|
|
| 363 |
gr.Markdown("### 📋 Hasil Caption")
|
| 364 |
gr.Markdown(
|
| 365 |
'<span style="font-size:12px;color:#999;">'
|
| 366 |
-
'
|
| 367 |
)
|
| 368 |
|
| 369 |
caption_boxes = []
|
| 370 |
caption_groups = []
|
| 371 |
for i in range(5):
|
| 372 |
with gr.Group(visible=(i < 3)) as group:
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
scale=5,
|
| 381 |
-
)
|
| 382 |
-
copy_btn = gr.CopyButton(value=box, scale=1)
|
| 383 |
caption_boxes.append(box)
|
| 384 |
caption_groups.append(group)
|
| 385 |
|
|
|
|
| 363 |
gr.Markdown("### 📋 Hasil Caption")
|
| 364 |
gr.Markdown(
|
| 365 |
'<span style="font-size:12px;color:#999;">'
|
| 366 |
+
'Blok teks caption lalu Ctrl+C / Cmd+C untuk copy</span>'
|
| 367 |
)
|
| 368 |
|
| 369 |
caption_boxes = []
|
| 370 |
caption_groups = []
|
| 371 |
for i in range(5):
|
| 372 |
with gr.Group(visible=(i < 3)) as group:
|
| 373 |
+
box = gr.Textbox(
|
| 374 |
+
label=f"Caption {i + 1}",
|
| 375 |
+
lines=4,
|
| 376 |
+
max_lines=8,
|
| 377 |
+
interactive=False,
|
| 378 |
+
elem_classes=["caption-output"],
|
| 379 |
+
)
|
|
|
|
|
|
|
|
|
|
| 380 |
caption_boxes.append(box)
|
| 381 |
caption_groups.append(group)
|
| 382 |
|