SugarAddict commited on
Commit
9b5f189
·
1 Parent(s): eaf5b89

Update updated_predict.py

Browse files
Files changed (1) hide show
  1. updated_predict.py +1 -1
updated_predict.py CHANGED
@@ -22,7 +22,7 @@ dataset = 'THUCNews'
22
  embedding = 'embedding_SougouNews.npz' # 预训练的词向量表
23
  config = module.Config(dataset, embedding)
24
  model = module.Model(config).to(config.device)
25
- model.load_state_dict(torch.load(config.save_path))
26
  model.eval()
27
 
28
 
 
22
  embedding = 'embedding_SougouNews.npz' # 预训练的词向量表
23
  config = module.Config(dataset, embedding)
24
  model = module.Model(config).to(config.device)
25
+ model.load_state_dict(torch.load(config.save_path,map_location='cpu'))
26
  model.eval()
27
 
28