adamelliotfields commited on
Commit
ae4d37d
·
verified ·
1 Parent(s): ab11d6f

Fix PyTorch warning

Browse files
Files changed (1) hide show
  1. lib/upscaler.py +1 -1
lib/upscaler.py CHANGED
@@ -274,7 +274,7 @@ class RealESRGAN:
274
  assert self.scale in [2, 4], "You can download models only with scales: 2, 4"
275
  config = HF_MODELS[self.scale]
276
  cache_path = hf_hub_download(config["repo_id"], filename=config["filename"])
277
- loadnet = torch.load(cache_path)
278
  if "params" in loadnet:
279
  self.model.load_state_dict(loadnet["params"], strict=True)
280
  elif "params_ema" in loadnet:
 
274
  assert self.scale in [2, 4], "You can download models only with scales: 2, 4"
275
  config = HF_MODELS[self.scale]
276
  cache_path = hf_hub_download(config["repo_id"], filename=config["filename"])
277
+ loadnet = torch.load(cache_path, weights_only=True)
278
  if "params" in loadnet:
279
  self.model.load_state_dict(loadnet["params"], strict=True)
280
  elif "params_ema" in loadnet: