UI refinements

#5
by multimodalart HF staff - opened
Files changed (1) hide show
  1. app.py +12 -8
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
- with gr.Blocks() as demo:
127
- gr.Markdown("<center><font size=8>Qwen-VL-Chat Bot</center>")
128
- gr.Markdown("<center><font size=3>Qwen-VL: A Multimodal Large Vision Language Model by Alibaba Cloud **Space by [@Artificialguybr](https://twitter.com/artificialguybr)</center>")
129
- 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.")
130
- chatbot = gr.Chatbot(label='Qwen-VL-Chat', elem_classes="control-height", height=750)
 
 
 
131
  query = gr.Textbox(lines=2, label='Input')
132
  task_history = gr.State([])
133
 
134
  with gr.Row():
135
- empty_bin = gr.Button("🧹 Clear History")
136
  submit_btn = gr.Button("🚀 Submit")
137
  regen_btn = gr.Button("🤔️ Regenerate")
138
- addfile_btn = gr.UploadButton("📁 Upload", file_types=["image"])
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
  )