Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,20 +44,20 @@ def upload_img(image,api_key,img_ques):
|
|
| 44 |
|
| 45 |
title = """<h1 align="center">GPT-4 Image Preview</h1>"""
|
| 46 |
|
| 47 |
-
with
|
| 48 |
-
|
| 49 |
|
| 50 |
-
with
|
| 51 |
-
with
|
| 52 |
-
image_input =
|
| 53 |
-
key_input =
|
| 54 |
-
upload_button =
|
| 55 |
-
btn_clear =
|
| 56 |
|
| 57 |
-
with
|
| 58 |
-
text =
|
| 59 |
-
ques_input =
|
| 60 |
-
ques_clear =
|
| 61 |
|
| 62 |
upload_button.click(upload_img, inputs=[image_input,key_input,ques_input], outputs=text)
|
| 63 |
btn_clear.add(text)
|
|
|
|
| 44 |
|
| 45 |
title = """<h1 align="center">GPT-4 Image Preview</h1>"""
|
| 46 |
|
| 47 |
+
with gr.Blocks() as demo:
|
| 48 |
+
gr.Markdown(title)
|
| 49 |
|
| 50 |
+
with gr.Row():
|
| 51 |
+
with gr.Column():
|
| 52 |
+
image_input = gr.Image(type="filepath", label="Upload Image")
|
| 53 |
+
key_input = gr.Textbox(label="Enter API-key")
|
| 54 |
+
upload_button = gr.Button(value="Upload & Start Chat", interactive=True, variant="primary")
|
| 55 |
+
btn_clear = gr.ClearButton([image_input,key_input],[text])
|
| 56 |
|
| 57 |
+
with gr.Column():
|
| 58 |
+
text = gr.Textbox(label="Output")
|
| 59 |
+
ques_input = gr.Textbox(label="Enter the question")
|
| 60 |
+
ques_clear = gr.ClearButton([ques_input])
|
| 61 |
|
| 62 |
upload_button.click(upload_img, inputs=[image_input,key_input,ques_input], outputs=text)
|
| 63 |
btn_clear.add(text)
|