Update app.py
Browse files
app.py
CHANGED
@@ -202,24 +202,18 @@ def _launch_demo(args, model, tokenizer):
|
|
202 |
Qwen-VL-Chat <a href="https://modelscope.cn/models/qwen/Qwen-VL-Chat/summary">🤖 </a> |
|
203 |
<a href="https://huggingface.co/Qwen/Qwen-VL-Chat">🤗</a>  |
|
204 |
 <a href="https://github.com/QwenLM/Qwen-VL">Github</a></center>""")
|
205 |
-
|
206 |
-
chatbot = gr.Chatbot(label='Qwen-VL-Chat')
|
207 |
-
query = gr.Textbox(lines=2, label='Input')
|
208 |
-
task_history = gr.State([])
|
209 |
-
|
210 |
with gr.Row():
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True)
|
223 |
|
224 |
gr.Markdown("""\
|
225 |
<font size=2>Note: This demo is governed by the original license of Qwen-VL. \
|
@@ -228,6 +222,16 @@ including hate speech, violence, pornography, deception, etc. \
|
|
228 |
(注:本演示受Qwen-VL的许可协议限制。我们强烈建议,用户不应传播及不应允许他人传播以下内容,\
|
229 |
包括但不限于仇恨言论、暴力、色情、欺诈相关的有害信息。)""")
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
demo.queue().launch(
|
232 |
share=args.share,
|
233 |
inbrowser=args.inbrowser,
|
|
|
202 |
Qwen-VL-Chat <a href="https://modelscope.cn/models/qwen/Qwen-VL-Chat/summary">🤖 </a> |
|
203 |
<a href="https://huggingface.co/Qwen/Qwen-VL-Chat">🤗</a>  |
|
204 |
 <a href="https://github.com/QwenLM/Qwen-VL">Github</a></center>""")
|
|
|
|
|
|
|
|
|
|
|
205 |
with gr.Row():
|
206 |
+
with gr.Column(scale=1):
|
207 |
+
chatbot = gr.Chatbot(label='Qwen-VL-Chat', interactive=True, max_messages=20)
|
208 |
+
with gr.Column(scale=1):
|
209 |
+
with gr.Row():
|
210 |
+
query = gr.Textbox(lines=2, label='Input', placeholder="Type your message here...")
|
211 |
+
submit_btn = gr.Button("🚀 Submit")
|
212 |
+
with gr.Row():
|
213 |
+
addfile_btn = gr.UploadButton("📁 Upload Image", file_types=["image"])
|
214 |
+
regen_btn = gr.Button("🤔️ Regenerate")
|
215 |
+
empty_bin = gr.Button("🧹 Clear History")
|
216 |
+
task_history = gr.State([])
|
|
|
217 |
|
218 |
gr.Markdown("""\
|
219 |
<font size=2>Note: This demo is governed by the original license of Qwen-VL. \
|
|
|
222 |
(注:本演示受Qwen-VL的许可协议限制。我们强烈建议,用户不应传播及不应允许他人传播以下内容,\
|
223 |
包括但不限于仇恨言论、暴力、色情、欺诈相关的有害信息。)""")
|
224 |
|
225 |
+
demo.style(
|
226 |
+
'''
|
227 |
+
<style>
|
228 |
+
.gr-button { margin: 5px; }
|
229 |
+
.gr-textbox { margin-bottom: 10px; }
|
230 |
+
.gr-chatbot { height: 500px; }
|
231 |
+
</style>
|
232 |
+
'''
|
233 |
+
)
|
234 |
+
|
235 |
demo.queue().launch(
|
236 |
share=args.share,
|
237 |
inbrowser=args.inbrowser,
|