NewBreaker commited on
Commit
3126b53
2 Parent(s): 1b76687 d498a70

Merge branch 'main' of https://huggingface.co/spaces/NewBreaker/chatglm-6b-int4

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,8 +1,8 @@
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().cpu()
6
 
7
 
8
  # from transformers import AutoTokenizer, AutoModel
@@ -12,9 +12,9 @@ model = AutoModel.from_pretrained(".\\models\\chatglm-6b-int4", trust_remote_cod
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="").half()
18
 
19
 
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().cpu()
6
 
7
 
8
  # from transformers import AutoTokenizer, AutoModel
 
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