Update app.py
Browse files
app.py
CHANGED
@@ -66,16 +66,33 @@ def inference(image):
|
|
66 |
|
67 |
return None # In case of unexpected errors
|
68 |
|
69 |
-
# Create Gradio interface
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
81 |
-
demo.launch()
|
|
|
66 |
|
67 |
return None # In case of unexpected errors
|
68 |
|
69 |
+
# Create Gradio interface using Blocks
|
70 |
+
with gr.Blocks() as demo:
|
71 |
+
gr.Markdown("# BugsBunny-LLama-3.2-11B-Base-Medium Demo")
|
72 |
+
|
73 |
+
with gr.Row():
|
74 |
+
# Container for the image takes full width
|
75 |
+
with gr.Column(scale=1):
|
76 |
+
image_input = gr.Image(
|
77 |
+
type="pil",
|
78 |
+
label="Upload Image",
|
79 |
+
elem_id="large-image",
|
80 |
+
height=500, # Increased height for larger display
|
81 |
+
)
|
82 |
+
|
83 |
+
with gr.Row():
|
84 |
+
# Container for the text output takes full width
|
85 |
+
with gr.Column(scale=1):
|
86 |
+
text_output = gr.Textbox(
|
87 |
+
label="Response",
|
88 |
+
elem_id="response-text",
|
89 |
+
lines=25,
|
90 |
+
max_lines=10,
|
91 |
+
)
|
92 |
+
|
93 |
+
# Button to trigger the analysis
|
94 |
+
submit_btn = gr.Button("Analyze Image", variant="primary")
|
95 |
+
submit_btn.click(fn=inference, inputs=[image_input], outputs=[text_output])
|
96 |
+
|
97 |
|
98 |
+
demo.launch()
|
|