kevinwang676 commited on
Commit
031b408
1 Parent(s): 3fc5ebe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -37,7 +37,7 @@ CHECKPOINT_PATH=f'checkpoint-600'
37
  tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True)
38
  config = AutoConfig.from_pretrained("chatglm2-6b", trust_remote_code=True, pre_seq_len=128)
39
  model = AutoModel.from_pretrained("chatglm2-6b", config=config, trust_remote_code=True)
40
- prefix_state_dict = torch.load(os.path.join(CHECKPOINT_PATH, "pytorch_model.bin"))
41
  new_prefix_state_dict = {}
42
  for k, v in prefix_state_dict.items():
43
  if k.startswith("transformer.prefix_encoder."):
 
37
  tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True)
38
  config = AutoConfig.from_pretrained("chatglm2-6b", trust_remote_code=True, pre_seq_len=128)
39
  model = AutoModel.from_pretrained("chatglm2-6b", config=config, trust_remote_code=True)
40
+ prefix_state_dict = torch.load(os.path.join(CHECKPOINT_PATH, "pytorch_model.bin"), map_location=torch.device('cpu'))
41
  new_prefix_state_dict = {}
42
  for k, v in prefix_state_dict.items():
43
  if k.startswith("transformer.prefix_encoder."):