aboutsummaryrefslogtreecommitdiff
path: root/modules/esrgan_model.py
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-05-09 22:17:58 +0300
committerAarni Koskela <akx@iki.fi>2023-05-09 22:25:39 +0300
commit3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb (patch)
tree77b2bea31c0e94ac67fddf86fdc7cba65a24af2c /modules/esrgan_model.py
parent8fb16ceb288a93f6ecaa45a0afcb3db718333e3e (diff)
Fix up string formatting/concatenation to f-strings where feasible
Diffstat (limited to 'modules/esrgan_model.py')
-rw-r--r--modules/esrgan_model.py11
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)