hjp157688 commited on
Commit
c9233bc
·
verified ·
1 Parent(s): 8730ea4

Update pages/对话式文本检测工具.py

Browse files
pages/对话式文本检测工具.py CHANGED
@@ -78,10 +78,8 @@ class Model(nn.Module):
78
 
79
  def load_models_and_predict(text, device):
80
  # 加载模型
81
- MacBERT_base_CDialBias = torch.load('models/MacBERT-base-CDialBias.pth')
82
- MacBERT_base_CDialBias.to(device)
83
- MacBERT_base_COLD = torch.load('models/MacBERT-base-CDialBias.pth')
84
- MacBERT_base_COLD.to(device)
85
 
86
  # 获取密钥和ID
87
  os.environ['APPBUILDER_TOKEN'] = "bce-v3/ALTAK-n2XgeA6FS3Q5E7Jab6UwE/850b44ebec64c4cad705986ab0b5e3df4b05d407"
 
78
 
79
  def load_models_and_predict(text, device):
80
  # 加载模型
81
+ MacBERT_base_CDialBias = torch.load('models/MacBERT-base-CDialBias.pth', map_location=torch.device('cpu'))
82
+ MacBERT_base_COLD = torch.load('models/MacBERT-base-CDialBias.pth', map_location=torch.device('cpu'))
 
 
83
 
84
  # 获取密钥和ID
85
  os.environ['APPBUILDER_TOKEN'] = "bce-v3/ALTAK-n2XgeA6FS3Q5E7Jab6UwE/850b44ebec64c4cad705986ab0b5e3df4b05d407"