Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/web_demo-checkpoint.py +6 -2
- web_demo.py +6 -2
.ipynb_checkpoints/web_demo-checkpoint.py
CHANGED
@@ -3,8 +3,12 @@ import gradio as gr
|
|
3 |
import mdtex2html
|
4 |
from utils import load_model_on_gpus
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
|
9 |
# from utils import load_model_on_gpus
|
10 |
# model = load_model_on_gpus("THUDM/chatglm2-6b", num_gpus=2)
|
|
|
3 |
import mdtex2html
|
4 |
from utils import load_model_on_gpus
|
5 |
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(r"THUDM/chatglm2-6b", trust_remote_code=True)
|
8 |
+
model = AutoModel.from_pretrained(r"THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
|
9 |
+
|
10 |
+
# tokenizer = AutoTokenizer.from_pretrained(r"/mnt/workspace/chatglm-6b", trust_remote_code=True)
|
11 |
+
# model = AutoModel.from_pretrained(r"/mnt/workspace/chatglm-6b", trust_remote_code=True).half().cuda()
|
12 |
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
|
13 |
# from utils import load_model_on_gpus
|
14 |
# model = load_model_on_gpus("THUDM/chatglm2-6b", num_gpus=2)
|
web_demo.py
CHANGED
@@ -3,8 +3,12 @@ import gradio as gr
|
|
3 |
import mdtex2html
|
4 |
from utils import load_model_on_gpus
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
|
9 |
# from utils import load_model_on_gpus
|
10 |
# model = load_model_on_gpus("THUDM/chatglm2-6b", num_gpus=2)
|
|
|
3 |
import mdtex2html
|
4 |
from utils import load_model_on_gpus
|
5 |
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(r"THUDM/chatglm2-6b", trust_remote_code=True)
|
8 |
+
model = AutoModel.from_pretrained(r"THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
|
9 |
+
|
10 |
+
# tokenizer = AutoTokenizer.from_pretrained(r"/mnt/workspace/chatglm-6b", trust_remote_code=True)
|
11 |
+
# model = AutoModel.from_pretrained(r"/mnt/workspace/chatglm-6b", trust_remote_code=True).half().cuda()
|
12 |
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
|
13 |
# from utils import load_model_on_gpus
|
14 |
# model = load_model_on_gpus("THUDM/chatglm2-6b", num_gpus=2)
|