adamelliotfields commited on
Commit
c871e5f
1 Parent(s): 7c70f20

Fix PyTorch warning

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