Keyven commited on
Commit
6c1f3a1
β€’
1 Parent(s): e8a4e36

Update UI and fix some bugs

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -148,20 +148,26 @@ with gr.Blocks(theme='gradio/soft') as demo:
148
  "'Describe this image', 'What can you see in this image?', or "
149
  "'Explain what's happening in this image'."
150
  )
151
- query = gr.Textbox(
152
- lines=2,
153
- label='Chat Input',
154
- placeholder='Type your question or statement here, or upload an image and ask about it...',
155
- hint='E.g., "Describe this image" or "What is the capital of France?"'
156
- )
157
- task_history = gr.State([])
158
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
  with gr.Row():
161
- upload_btn = gr.File(label="πŸ–ΌοΈ Upload", file_types=["image"], elem_classes="control-width")
162
- submit_btn = gr.Button("πŸš€ Submit", elem_classes="control-width", variant="primary")
163
- regen_btn = gr.Button("πŸ”„ Regenerate", elem_classes="control-width")
164
- clear_btn = gr.Button("🧹 Clear History", elem_classes="control-width", variant="secondary")
 
 
165
 
166
  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.")
167
  submit_btn.click(handle_text_input, [chatbot, task_history, query], [chatbot, task_history]).then(
 
148
  "'Describe this image', 'What can you see in this image?', or "
149
  "'Explain what's happening in this image'."
150
  )
 
 
 
 
 
 
 
151
 
152
+ with gr.Row(): # Erste Zeile fΓΌr Eingabefelder
153
+ with gr.Column(width=6):
154
+ query = gr.Textbox(
155
+ lines=2,
156
+ label='Chat Input',
157
+ placeholder='Type your question or statement here, or upload an image and ask about it...',
158
+ hint='E.g., "Describe this image" or "What is the capital of France?"'
159
+ )
160
+ task_history = gr.State([])
161
+ with gr.Column(width=6):
162
+ upload_btn = gr.File(label="πŸ–ΌοΈ Upload", file_types=["image"], elem_classes="control-width")
163
 
164
  with gr.Row():
165
+ with gr.Column(width=6):
166
+ submit_btn = gr.Button("πŸš€ Submit", elem_classes="control-width", variant="primary")
167
+ with gr.Column(width=3):
168
+ regen_btn = gr.Button("πŸ”„ Regenerate", elem_classes="control-width")
169
+ with gr.Column(width=3):
170
+ clear_btn = gr.Button("🧹 Clear History", elem_classes="control-width", variant="secondary")
171
 
172
  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.")
173
  submit_btn.click(handle_text_input, [chatbot, task_history, query], [chatbot, task_history]).then(