mikeee commited on
Commit
d7ec399
1 Parent(s): 60399ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,12 +1,14 @@
1
  import os
2
- os.system("pip install --upgrade torch transformers sentencepiece scipy cpm_kernels accelerate bitsandbytes")
3
 
4
 
5
  import gradio as gr
6
  from transformers import AutoTokenizer, AutoModelForCausalLM
7
 
8
- # tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b-int4", trust_remote_code=True)
 
9
  model = AutoModel.from_pretrained("THUDM/chatglm2-6b-int4", trust_remote_code=True)
 
10
  # tokenizer = AutoTokenizer.from_pretrained("openchat/openchat_v2_w")
11
  # model = AutoModelForCausalLM.from_pretrained("openchat/openchat_v2_w", load_in_8bit_fp32_cpu_offload=True, load_in_8bit=True)
12
  model.half()
 
1
  import os
2
+ os.system("pip install --upgrade torch transformers sentencepiece scipy cpm_kernels accelerate bitsandbytes loguru")
3
 
4
 
5
  import gradio as gr
6
  from transformers import AutoTokenizer, AutoModelForCausalLM
7
 
8
+ tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b-int4", trust_remote_code=True)
9
+ logger.debug("load")
10
  model = AutoModel.from_pretrained("THUDM/chatglm2-6b-int4", trust_remote_code=True)
11
+ logger.debug("done load")
12
  # tokenizer = AutoTokenizer.from_pretrained("openchat/openchat_v2_w")
13
  # model = AutoModelForCausalLM.from_pretrained("openchat/openchat_v2_w", load_in_8bit_fp32_cpu_offload=True, load_in_8bit=True)
14
  model.half()