Spaces:
Runtime error
Runtime error
NewBreaker
commited on
Commit
•
a78bf18
1
Parent(s):
3126b53
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
from transformers import AutoTokenizer, AutoModel
|
2 |
import gradio as gr
|
3 |
|
|
|
4 |
# tokenizer = AutoTokenizer.from_pretrained(".\\models\\chatglm-6b-int4", trust_remote_code=True, revision="")
|
5 |
-
# model = AutoModel.from_pretrained(".\\models\\chatglm-6b-int4", trust_remote_code=True, revision="").half().cuda()
|
6 |
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
# model = model.eval()
|
12 |
|
13 |
|
|
|
14 |
# kernel_file = "./models/chatglm-6b-int4/quantization_kernels.so"
|
15 |
-
tokenizer = AutoTokenizer.from_pretrained("./models/chatglm-6b-int4", trust_remote_code=True, revision="")
|
16 |
# model = AutoModel.from_pretrained("./models/chatglm-6b-int4", trust_remote_code=True, revision="").half().cuda()
|
17 |
-
model = AutoModel.from_pretrained("./models/chatglm-6b-int4", trust_remote_code=True, revision="").float()
|
18 |
|
19 |
|
20 |
|
|
|
1 |
from transformers import AutoTokenizer, AutoModel
|
2 |
import gradio as gr
|
3 |
|
4 |
+
# chatglm-6b-int4 cuda,本地可以运行成功
|
5 |
# tokenizer = AutoTokenizer.from_pretrained(".\\models\\chatglm-6b-int4", trust_remote_code=True, revision="")
|
6 |
+
# model = AutoModel.from_pretrained(".\\models\\chatglm-6b-int4", trust_remote_code=True, revision="").half().cuda()
|
7 |
|
8 |
|
9 |
+
# chatglm-6b CPU,
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
|
11 |
+
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half()
|
|
|
12 |
|
13 |
|
14 |
+
# chatglm-6b
|
15 |
# kernel_file = "./models/chatglm-6b-int4/quantization_kernels.so"
|
16 |
+
# tokenizer = AutoTokenizer.from_pretrained("./models/chatglm-6b-int4", trust_remote_code=True, revision="")
|
17 |
# model = AutoModel.from_pretrained("./models/chatglm-6b-int4", trust_remote_code=True, revision="").half().cuda()
|
|
|
18 |
|
19 |
|
20 |
|