ybelkada HF staff commited on
Commit
d8ca1f3
1 Parent(s): 1fe1d3c

Fix map_location issue

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -11,7 +11,7 @@ from huggingface_hub import hf_hub_download
11
 
12
  def check_simple_file(st_weights_path, torch_weights_path):
13
  st_weights = safetensors.torch.load_file(st_weights_path)
14
- torch_weights = torch.load(torch_weights_path)
15
 
16
  # check if keys are the same
17
  if st_weights.keys() != torch_weights.keys():
 
11
 
12
  def check_simple_file(st_weights_path, torch_weights_path):
13
  st_weights = safetensors.torch.load_file(st_weights_path)
14
+ torch_weights = torch.load(torch_weights_path, map_location=torch.device('cpu'))
15
 
16
  # check if keys are the same
17
  if st_weights.keys() != torch_weights.keys():