Narsil HF staff commited on
Commit
c968ad4
1 Parent(s): cbdc5ec

Update convert.py

Browse files
Files changed (1) hide show
  1. convert.py +1 -1
convert.py CHANGED
@@ -95,7 +95,7 @@ def convert_file(
95
  pt_filename: str,
96
  sf_filename: str,
97
  ):
98
- loaded = torch.load(pt_filename)
99
  if "state_dict" in loaded:
100
  loaded = loaded["state_dict"]
101
  shared = shared_pointers(loaded)
 
95
  pt_filename: str,
96
  sf_filename: str,
97
  ):
98
+ loaded = torch.load(pt_filename, map_location="cpu")
99
  if "state_dict" in loaded:
100
  loaded = loaded["state_dict"]
101
  shared = shared_pointers(loaded)