Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -152,13 +152,15 @@ with gr.Blocks(title="moondream vl (new)") as demo:
|
|
| 152 |
img.change(answer_question, [img, prompt], output)
|
| 153 |
elif mode == "Caption":
|
| 154 |
with gr.Group():
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
| 160 |
img = gr.Image(type="pil", label="Upload an Image")
|
| 161 |
-
|
| 162 |
img.change(caption, [img, caption_mode], output)
|
| 163 |
else:
|
| 164 |
gr.Markdown("Coming soon!")
|
|
|
|
| 152 |
img.change(answer_question, [img, prompt], output)
|
| 153 |
elif mode == "Caption":
|
| 154 |
with gr.Group():
|
| 155 |
+
with gr.Row():
|
| 156 |
+
caption_mode = gr.Radio(
|
| 157 |
+
["Short", "Normal"],
|
| 158 |
+
show_label=False,
|
| 159 |
+
value=lambda: "Normal",
|
| 160 |
+
)
|
| 161 |
+
submit = gr.Button("Submit")
|
| 162 |
img = gr.Image(type="pil", label="Upload an Image")
|
| 163 |
+
submit.click(caption, [img, caption_mode], output)
|
| 164 |
img.change(caption, [img, caption_mode], output)
|
| 165 |
else:
|
| 166 |
gr.Markdown("Coming soon!")
|