Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,16 +65,17 @@ def ask_about_image(image, prompt):
|
|
| 65 |
|
| 66 |
with gr.Blocks(css="""
|
| 67 |
#resp_box textarea {
|
| 68 |
-
min-height: 96px;
|
| 69 |
-
max-height: 180px;
|
| 70 |
-
overflow: auto;
|
| 71 |
-
resize: none;
|
| 72 |
-
line-height: 1.2;
|
| 73 |
-
white-space: pre-wrap;
|
| 74 |
}
|
| 75 |
#resp_box label { margin-bottom: 4px; }
|
| 76 |
""") as demo:
|
| 77 |
gr.Markdown("## 🧠 Qwen2.5-VL-3B — Visual Reasoning Assistant")
|
|
|
|
| 78 |
with gr.Row():
|
| 79 |
image = gr.Image(type="pil", label="Upload an Image")
|
| 80 |
with gr.Column():
|
|
@@ -84,15 +85,17 @@ with gr.Blocks(css="""
|
|
| 84 |
)
|
| 85 |
ask_button = gr.Button("Ask")
|
| 86 |
|
| 87 |
-
# Compact
|
| 88 |
answer = gr.Textbox(
|
| 89 |
label="Response",
|
| 90 |
-
lines=4,
|
| 91 |
-
interactive=False, #
|
| 92 |
-
elem_id="resp_box"
|
| 93 |
)
|
| 94 |
|
| 95 |
-
|
|
|
|
| 96 |
|
| 97 |
demo.launch()
|
| 98 |
|
|
|
|
|
|
| 65 |
|
| 66 |
with gr.Blocks(css="""
|
| 67 |
#resp_box textarea {
|
| 68 |
+
min-height: 96px;
|
| 69 |
+
max-height: 180px;
|
| 70 |
+
overflow: auto;
|
| 71 |
+
resize: none;
|
| 72 |
+
line-height: 1.2;
|
| 73 |
+
white-space: pre-wrap;
|
| 74 |
}
|
| 75 |
#resp_box label { margin-bottom: 4px; }
|
| 76 |
""") as demo:
|
| 77 |
gr.Markdown("## 🧠 Qwen2.5-VL-3B — Visual Reasoning Assistant")
|
| 78 |
+
|
| 79 |
with gr.Row():
|
| 80 |
image = gr.Image(type="pil", label="Upload an Image")
|
| 81 |
with gr.Column():
|
|
|
|
| 85 |
)
|
| 86 |
ask_button = gr.Button("Ask")
|
| 87 |
|
| 88 |
+
# ✅ Compact area showing only the assistant’s answer
|
| 89 |
answer = gr.Textbox(
|
| 90 |
label="Response",
|
| 91 |
+
lines=4,
|
| 92 |
+
interactive=False, # user cannot edit
|
| 93 |
+
elem_id="resp_box"
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# The model’s pure output only
|
| 97 |
+
ask_button.click(fn=ask_about_image, inputs=[image, question], outputs=[answer])
|
| 98 |
|
| 99 |
demo.launch()
|
| 100 |
|
| 101 |
+
|