diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-09 22:42:37 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-09 22:42:37 +0300 |
commit | c8791c1d37502f162b8616b066303bfadc4a749b (patch) | |
tree | 6843c3505117f26549dfe1dc9cd40aacd5ccdfd3 /modules/esrgan_model.py | |
parent | 6fbd85dd0c0dffc06560bff91f4c4b65e441ca5f (diff) | |
parent | 31397986e70d20e392d9c3ec70d3aef8ecc2c1ff (diff) |
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/esrgan_model.py')
-rw-r--r-- | modules/esrgan_model.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/esrgan_model.py b/modules/esrgan_model.py index 9a9c38f1..f4369257 100644 --- a/modules/esrgan_model.py +++ b/modules/esrgan_model.py @@ -156,13 +156,16 @@ class UpscalerESRGAN(Upscaler): def load_model(self, path: str):
if "http" in path:
- filename = load_file_from_url(url=self.model_url, model_dir=self.model_path,
- file_name="%s.pth" % self.model_name,
- progress=True)
+ filename = load_file_from_url(
+ url=self.model_url,
+ model_dir=self.model_path,
+ file_name=f"{self.model_name}.pth",
+ progress=True,
+ )
else:
filename = path
if not os.path.exists(filename) or filename is None:
- print("Unable to load %s from %s" % (self.model_path, filename))
+ print(f"Unable to load {self.model_path} from {filename}")
return None
state_dict = torch.load(filename, map_location='cpu' if devices.device_esrgan.type == 'mps' else None)
|