yuhj95 commited on
Commit
52fd0c0
1 Parent(s): ea9d466

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. sampler.py +1 -1
sampler.py CHANGED
@@ -117,7 +117,7 @@ class BaseSampler:
117
  self.autoencoder = None
118
 
119
  def load_model(self, model, ckpt_path=None):
120
- state = torch.load(ckpt_path, map_location=f"cuda:{self.rank}")
121
  if 'state_dict' in state:
122
  state = state['state_dict']
123
  util_net.reload_model(model, state)
 
117
  self.autoencoder = None
118
 
119
  def load_model(self, model, ckpt_path=None):
120
+ state = torch.load(ckpt_path, map_location=torch.device('cpu'))
121
  if 'state_dict' in state:
122
  state = state['state_dict']
123
  util_net.reload_model(model, state)