Update app.py
Browse files
app.py
CHANGED
@@ -98,37 +98,37 @@ def xform_image_description(img, inst):
|
|
98 |
return res.choices[0].text[len(prompt):].split("```")[0]
|
99 |
|
100 |
with gr.Blocks() as demo:
|
101 |
-
|
102 |
-
with gr.Column():
|
103 |
-
with gr.Row():
|
104 |
-
img = gr.Image(label="images", type='pil')
|
105 |
-
with gr.Row():
|
106 |
-
btn = gr.Button("submit")
|
107 |
-
with gr.Row():
|
108 |
-
otpt = gr.Textbox(label="output", lines=3, interactive=True)
|
109 |
-
with gr.Row():
|
110 |
with gr.Column():
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
return res.choices[0].text[len(prompt):].split("```")[0]
|
99 |
|
100 |
with gr.Blocks() as demo:
|
101 |
+
with gr.Row(visible=True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
with gr.Column():
|
103 |
+
with gr.Row():
|
104 |
+
img = gr.Image(label="images", type='pil')
|
105 |
+
with gr.Row():
|
106 |
+
btn = gr.Button("submit")
|
107 |
+
with gr.Row():
|
108 |
+
otpt = gr.Textbox(label="output", lines=3, interactive=True)
|
109 |
+
with gr.Row():
|
110 |
+
with gr.Column():
|
111 |
+
im1 = gr.Image(label="image 1", type='pil')
|
112 |
+
otp2 = gr.Textbox(label="image 1", interactive=True)
|
113 |
+
with gr.Column():
|
114 |
+
im2 = gr.Image(label="image 2", type='pil')
|
115 |
+
otp3 = gr.Textbox(label="image 2")
|
116 |
+
with gr.Row():
|
117 |
+
minst = gr.Textbox(label="Merge Instructions")
|
118 |
+
with gr.Row():
|
119 |
+
btn2 = gr.Button("submit batch")
|
120 |
+
with gr.Row():
|
121 |
+
with gr.Column():
|
122 |
+
otp2 = gr.Textbox(label="individual batch output (left)", interactive=True)
|
123 |
+
with gr.Column():
|
124 |
+
otp3 = gr.Textbox(label="individual batch output (right)", interactive=True)
|
125 |
+
with gr.Row():
|
126 |
+
btn_scd = gr.Button("Merge Descriptions to Single Combined Description")
|
127 |
+
with gr.Row():
|
128 |
+
otp4 = gr.Textbox(label="batch output ( combined )", interactive=True, lines=4)
|
129 |
+
btn2.click(dual_images, inputs=[im1], outputs=[otp2])
|
130 |
+
btn2.click(dual_images, inputs=[im2], outputs=[otp3])
|
131 |
+
btn.click(dual_images, inputs=[img], outputs=[otpt])
|
132 |
+
btn_scd.click(merge_descriptions_to_prompt, inputs=[minst, otp2, otp3], outputs=[otp4])
|
133 |
+
|
134 |
+
demo.launch(debug=True, share=True)
|