Spaces:
Runtime error
Runtime error
update code
Browse files
app.py
CHANGED
@@ -145,20 +145,28 @@ css = '''
|
|
145 |
}
|
146 |
'''
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
)
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|