Spaces:
Running
Running
Dongxu Li
commited on
Commit
·
6b1676b
1
Parent(s):
e7d2256
update ui.
Browse files
app.py
CHANGED
|
@@ -125,13 +125,6 @@ def inference_caption(
|
|
| 125 |
return output[0]
|
| 126 |
|
| 127 |
|
| 128 |
-
# def clear_fn(image_input, chatbot, chat_input, caption_output, state):
|
| 129 |
-
# # if image_input is None:
|
| 130 |
-
# return (None, "", "", [])
|
| 131 |
-
# else:
|
| 132 |
-
# return chatbot, chat_input, caption_output, state
|
| 133 |
-
|
| 134 |
-
|
| 135 |
title = """<h1 align="center">BLIP-2</h1>"""
|
| 136 |
description = """Gradio demo for BLIP-2, image-to-text generation from Salesforce Research. To use it, simply upload your image, or click one of the examples to load them.
|
| 137 |
<br> <strong>Disclaimer</strong>: This is a research prototype and is not intended for production use. No data including but not restricted to text and images is collected."""
|
|
@@ -149,7 +142,9 @@ examples = [
|
|
| 149 |
["forbidden_city.webp", "In what dynasties was this place built?"],
|
| 150 |
]
|
| 151 |
|
| 152 |
-
with gr.Blocks(
|
|
|
|
|
|
|
| 153 |
state = gr.State([])
|
| 154 |
|
| 155 |
gr.Markdown(title)
|
|
@@ -216,8 +211,12 @@ with gr.Blocks() as iface:
|
|
| 216 |
|
| 217 |
gr.Markdown("""Trying prompting your input for chat; e.g. example prompt for QA, \"Question: {} Answer:\"""")
|
| 218 |
with gr.Row():
|
| 219 |
-
with gr.Column(
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
|
| 222 |
# with gr.Row():
|
| 223 |
with gr.Column(scale=1):
|
|
|
|
| 125 |
return output[0]
|
| 126 |
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
title = """<h1 align="center">BLIP-2</h1>"""
|
| 129 |
description = """Gradio demo for BLIP-2, image-to-text generation from Salesforce Research. To use it, simply upload your image, or click one of the examples to load them.
|
| 130 |
<br> <strong>Disclaimer</strong>: This is a research prototype and is not intended for production use. No data including but not restricted to text and images is collected."""
|
|
|
|
| 142 |
["forbidden_city.webp", "In what dynasties was this place built?"],
|
| 143 |
]
|
| 144 |
|
| 145 |
+
with gr.Blocks(
|
| 146 |
+
css=""".message.svelte-w6rprc.svelte-w6rprc.svelte-w6rprc {font-size: 20px; margin-top: 20px}"""
|
| 147 |
+
) as iface:
|
| 148 |
state = gr.State([])
|
| 149 |
|
| 150 |
gr.Markdown(title)
|
|
|
|
| 211 |
|
| 212 |
gr.Markdown("""Trying prompting your input for chat; e.g. example prompt for QA, \"Question: {} Answer:\"""")
|
| 213 |
with gr.Row():
|
| 214 |
+
with gr.Column(
|
| 215 |
+
scale=1.5,
|
| 216 |
+
):
|
| 217 |
+
chatbot = gr.Chatbot(
|
| 218 |
+
label="Chat Output (from FlanT5)",
|
| 219 |
+
)
|
| 220 |
|
| 221 |
# with gr.Row():
|
| 222 |
with gr.Column(scale=1):
|