Spaces:
Runtime error
Runtime error
Update app
Browse files
app.py
CHANGED
|
@@ -133,8 +133,41 @@ def handle_regeneration(chatbot, task_history):
|
|
| 133 |
|
| 134 |
# Custom CSS
|
| 135 |
css = '''
|
| 136 |
-
.
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
}
|
| 139 |
'''
|
| 140 |
|
|
@@ -150,10 +183,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 150 |
task_history = gr.State([])
|
| 151 |
|
| 152 |
with gr.Row():
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
gr.Markdown("### Key Features:\n- **Strong Performance**: Surpasses existing LVLMs on multiple English benchmarks including Zero-shot Captioning and VQA.\n- **Multi-lingual Support**: Supports English, Chinese, and multi-lingual conversation.\n- **High Resolution**: Utilizes 448*448 resolution for fine-grained recognition and understanding.")
|
| 159 |
submit_btn.click(handle_text_input, [chatbot, task_history, query], [chatbot, task_history]).then(
|
|
|
|
| 133 |
|
| 134 |
# Custom CSS
|
| 135 |
css = '''
|
| 136 |
+
@import url('https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
|
| 137 |
+
|
| 138 |
+
.gradio-button, .gradio-upload-button {
|
| 139 |
+
border: none;
|
| 140 |
+
border-radius: 4px;
|
| 141 |
+
cursor: pointer;
|
| 142 |
+
font-size: 16px;
|
| 143 |
+
margin: 2px;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.gradio-button {
|
| 147 |
+
background-color: #008CBA;
|
| 148 |
+
color: white;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
.gradio-button:hover {
|
| 152 |
+
background-color: #005f5f;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.gradio-upload-button input {
|
| 156 |
+
display: none;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.gradio-upload-button {
|
| 160 |
+
background-color: #008CBA;
|
| 161 |
+
color: white;
|
| 162 |
+
padding: 10px 20px;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.gradio-upload-button:hover {
|
| 166 |
+
background-color: #005f5f;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
.control-width {
|
| 170 |
+
width: 100%;
|
| 171 |
}
|
| 172 |
'''
|
| 173 |
|
|
|
|
| 183 |
task_history = gr.State([])
|
| 184 |
|
| 185 |
with gr.Row():
|
| 186 |
+
with gr.Column(width=4):
|
| 187 |
+
upload_btn = gr.UploadButton("π Upload", file_types=["image"], elem_classes="control-width")
|
| 188 |
+
with gr.Column(width=2):
|
| 189 |
+
submit_btn = gr.Button("π Submit", elem_classes="control-width")
|
| 190 |
+
with gr.Column(width=2):
|
| 191 |
+
regen_btn = gr.Button("π€οΈ Regenerate", elem_classes="control-width")
|
| 192 |
+
with gr.Column(width=2):
|
| 193 |
+
clear_btn = gr.Button("π§Ή Clear History", elem_classes="control-width")
|
| 194 |
|
| 195 |
gr.Markdown("### Key Features:\n- **Strong Performance**: Surpasses existing LVLMs on multiple English benchmarks including Zero-shot Captioning and VQA.\n- **Multi-lingual Support**: Supports English, Chinese, and multi-lingual conversation.\n- **High Resolution**: Utilizes 448*448 resolution for fine-grained recognition and understanding.")
|
| 196 |
submit_btn.click(handle_text_input, [chatbot, task_history, query], [chatbot, task_history]).then(
|