Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
-
# Copyright (c) Alibaba Cloud.
|
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 |
-
|
8 |
import copy
|
9 |
import gradio as gr
|
10 |
import os
|
@@ -14,13 +12,13 @@ import tempfile
|
|
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>"
|
21 |
PUNCTUATION = "!?。"#$%&'()*+,-/:;<=>@[\]^_`{|}~⦅⦆「」、、〃》「」『』【】〔〕〖〗〘〙〚〛〜〝〞〟〰〾〿–—‘’‛“”„‟…‧﹏."
|
22 |
|
23 |
-
|
24 |
def _get_args():
|
25 |
parser = ArgumentParser()
|
26 |
parser.add_argument("-c", "--checkpoint-path", type=str, default=DEFAULT_CKPT_PATH,
|
|
|
|
|
|
|
1 |
# This source code is licensed under the license found in the
|
2 |
# LICENSE file in the root directory of this source tree.
|
3 |
+
|
4 |
from argparse import ArgumentParser
|
5 |
from pathlib import Path
|
|
|
6 |
import copy
|
7 |
import gradio as gr
|
8 |
import os
|
|
|
12 |
from modelscope import (
|
13 |
AutoModelForCausalLM, AutoTokenizer, GenerationConfig, snapshot_download
|
14 |
)
|
15 |
+
|
16 |
os.environ['CUDA_VISIBLE_DEVICES'] = '0,1'
|
17 |
DEFAULT_CKPT_PATH = 'qwen/Qwen-VL-Chat'
|
18 |
REVISION = 'v1.0.4'
|
19 |
BOX_TAG_PATTERN = r"<box>([\s\S]*?)</box>"
|
20 |
PUNCTUATION = "!?。"#$%&'()*+,-/:;<=>@[\]^_`{|}~⦅⦆「」、、〃》「」『』【】〔〕〖〗〘〙〚〛〜〝〞〟〰〾〿–—‘’‛“”„‟…‧﹏."
|
21 |
|
|
|
22 |
def _get_args():
|
23 |
parser = ArgumentParser()
|
24 |
parser.add_argument("-c", "--checkpoint-path", type=str, default=DEFAULT_CKPT_PATH,
|