Keyven commited on
Commit
64f1def
β€’
1 Parent(s): 2f4b8e0

update code

Browse files
Files changed (1) hide show
  1. app.py +24 -16
app.py CHANGED
@@ -145,20 +145,28 @@ css = '''
145
  }
146
  '''
147
 
148
- iface = gr.Interface(
149
- fn=main_function,
150
- inputs=[
151
- gr.inputs.Textbox(lines=2, label='Input'),
152
- gr.inputs.Image(type='file', label='Upload Image')
153
- ],
154
- outputs='text',
155
- live=True,
156
- layout='vertical',
157
- theme='huggingface',
158
- css=css
159
- )
160
-
161
- iface.add_button("🧹 Clear History", clear_history_fn)
162
-
163
- iface.launch(share=True)
 
 
 
 
 
 
 
 
164
 
 
145
  }
146
  '''
147
 
148
+ with gr.Blocks(css=css) as demo:
149
+ gr.Markdown("# Qwen-VL-Chat Bot")
150
+ gr.Markdown(
151
+ "## Developed by Keyvan Hardani (Keyvven on [Twitter](https://twitter.com/Keyvven))\n"
152
+ "Special thanks to [@Artificialguybr](https://twitter.com/artificialguybr) for the inspiration from his code.\n"
153
+ "### Qwen-VL: A Multimodal Large Vision Language Model by Alibaba Cloud\n"
154
+ )
155
+ chat_interface = gr.Interface(
156
+ fn=main_function,
157
+ inputs=[
158
+ gr.inputs.Textbox(lines=2, label='Input'),
159
+ gr.inputs.Image(type='file', label='Upload Image')
160
+ ],
161
+ outputs='text',
162
+ live=True,
163
+ layout='vertical',
164
+ theme='huggingface',
165
+ css=css
166
+ ).launch()
167
+ 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.")
168
+
169
+ demo.add_button("🧹 Clear History", clear_history_fn)
170
+
171
+ demo.launch(share=True)
172