ppak10 commited on
Commit
6a286a9
·
1 Parent(s): ec0f47c

Updates t5 model to load with cpu.

Browse files
Files changed (1) hide show
  1. model/t5.py +1 -1
model/t5.py CHANGED
@@ -20,7 +20,7 @@ class T5ClassificationModel(nn.Module):
20
  self.base_model = T5EncoderModel(config)
21
 
22
  # Load the state_dict and remove unwanted keys
23
- state_dict = torch.load(pytorch_model_path)
24
  filtered_state_dict = {
25
  k.replace("base_model.", ""): v
26
  for k, v in state_dict.items()
 
20
  self.base_model = T5EncoderModel(config)
21
 
22
  # Load the state_dict and remove unwanted keys
23
+ state_dict = torch.load(pytorch_model_path, map_location=torch.device("cpu"))
24
  filtered_state_dict = {
25
  k.replace("base_model.", ""): v
26
  for k, v in state_dict.items()