Commit
·
112cb22
1
Parent(s):
8a73b38
UI refinements (#5)
Browse files- UI refinements (81d45ed659b17aa38b06dd826498efb5ebeeadac)
Co-authored-by: Apolinário from multimodal AI art <[email protected]>
app.py
CHANGED
@@ -123,20 +123,24 @@ def regenerate(_chatbot, task_history):
|
|
123 |
print("After:", task_history, _chatbot)
|
124 |
return predict(_chatbot, task_history)
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
131 |
query = gr.Textbox(lines=2, label='Input')
|
132 |
task_history = gr.State([])
|
133 |
|
134 |
with gr.Row():
|
135 |
-
|
136 |
submit_btn = gr.Button("🚀 Submit")
|
137 |
regen_btn = gr.Button("🤔️ Regenerate")
|
138 |
-
|
139 |
-
|
|
|
140 |
submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history]).then(
|
141 |
predict, [chatbot, task_history], [chatbot], show_progress=True
|
142 |
)
|
|
|
123 |
print("After:", task_history, _chatbot)
|
124 |
return predict(_chatbot, task_history)
|
125 |
|
126 |
+
css = '''
|
127 |
+
.gradio-container{max-width:800px}
|
128 |
+
'''
|
129 |
+
|
130 |
+
with gr.Blocks(css) as demo:
|
131 |
+
gr.Markdown("# Qwen-VL-Chat Bot")
|
132 |
+
gr.Markdown("## Qwen-VL: A Multimodal Large Vision Language Model by Alibaba Cloud **Space by [@Artificialguybr](https://twitter.com/artificialguybr)</center>")
|
133 |
+
chatbot = gr.Chatbot(label='Qwen-VL-Chat', elem_classes="control-height", height=520)
|
134 |
query = gr.Textbox(lines=2, label='Input')
|
135 |
task_history = gr.State([])
|
136 |
|
137 |
with gr.Row():
|
138 |
+
addfile_btn = gr.UploadButton("📁 Upload", file_types=["image"])
|
139 |
submit_btn = gr.Button("🚀 Submit")
|
140 |
regen_btn = gr.Button("🤔️ Regenerate")
|
141 |
+
empty_bin = gr.Button("🧹 Clear History")
|
142 |
+
|
143 |
+
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.")
|
144 |
submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history]).then(
|
145 |
predict, [chatbot, task_history], [chatbot], show_progress=True
|
146 |
)
|