Spaces:
Running
on
Zero
Running
on
Zero
Fix PyTorch warning
Browse files- 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:
|