Update app.py
Browse files
app.py
CHANGED
@@ -2,12 +2,6 @@
|
|
2 |
#
|
3 |
# This source code is licensed under the license found in the
|
4 |
# LICENSE file in the root directory of this source tree.
|
5 |
-
import os
|
6 |
-
os.system('pip install tiktoken')
|
7 |
-
os.system('pip install "modelscope" --upgrade -f https://pypi.org/project/modelscope/')
|
8 |
-
os.system('pip install transformers_stream_generator')
|
9 |
-
|
10 |
-
# os.environ['CUDA_VISIBLE_DEVICES'] = '0,1'
|
11 |
from argparse import ArgumentParser
|
12 |
from pathlib import Path
|
13 |
|
@@ -20,7 +14,7 @@ import tempfile
|
|
20 |
from modelscope import (
|
21 |
AutoModelForCausalLM, AutoTokenizer, GenerationConfig, snapshot_download
|
22 |
)
|
23 |
-
|
24 |
DEFAULT_CKPT_PATH = 'qwen/Qwen-VL-Chat'
|
25 |
REVISION = 'v1.0.4'
|
26 |
BOX_TAG_PATTERN = r"<box>([\s\S]*?)</box>"
|
@@ -204,7 +198,7 @@ Qwen-VL-Chat <a href="https://modelscope.cn/models/qwen/Qwen-VL-Chat/summary">
|
|
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'
|
208 |
with gr.Column(scale=1):
|
209 |
with gr.Row():
|
210 |
query = gr.Textbox(lines=2, label='Input', placeholder="Type your message here...")
|
|
|
2 |
#
|
3 |
# This source code is licensed under the license found in the
|
4 |
# LICENSE file in the root directory of this source tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from argparse import ArgumentParser
|
6 |
from pathlib import Path
|
7 |
|
|
|
14 |
from modelscope import (
|
15 |
AutoModelForCausalLM, AutoTokenizer, GenerationConfig, snapshot_download
|
16 |
)
|
17 |
+
os.environ['CUDA_VISIBLE_DEVICES'] = '0,1'
|
18 |
DEFAULT_CKPT_PATH = 'qwen/Qwen-VL-Chat'
|
19 |
REVISION = 'v1.0.4'
|
20 |
BOX_TAG_PATTERN = r"<box>([\s\S]*?)</box>"
|
|
|
198 |
 <a href="https://github.com/QwenLM/Qwen-VL">Github</a></center>""")
|
199 |
with gr.Row():
|
200 |
with gr.Column(scale=1):
|
201 |
+
chatbot = gr.Chatbot(label='Qwen-VL-Chat')
|
202 |
with gr.Column(scale=1):
|
203 |
with gr.Row():
|
204 |
query = gr.Textbox(lines=2, label='Input', placeholder="Type your message here...")
|