diff options
author | Aarni Koskela <akx@iki.fi> | 2023-05-09 19:17:58 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-05-09 19:25:39 +0000 |
commit | 3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb (patch) | |
tree | 77b2bea31c0e94ac67fddf86fdc7cba65a24af2c /modules/esrgan_model.py | |
parent | 8fb16ceb288a93f6ecaa45a0afcb3db718333e3e (diff) | |
download | stable-diffusion-webui-gfx803-3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb.tar.gz stable-diffusion-webui-gfx803-3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb.tar.bz2 stable-diffusion-webui-gfx803-3ba6c3c83c0983a025c7bddc08bb7f49481b3cbb.zip |
Fix up string formatting/concatenation to f-strings where feasible
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)
|