mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Fix up string formatting/concatenation to f-strings where feasible
This commit is contained in:
@@ -223,7 +223,7 @@ class DDPM(pl.LightningModule):
|
||||
for k in keys:
|
||||
for ik in ignore_keys:
|
||||
if k.startswith(ik):
|
||||
print("Deleting key {} from state_dict.".format(k))
|
||||
print(f"Deleting key {k} from state_dict.")
|
||||
del sd[k]
|
||||
missing, unexpected = self.load_state_dict(sd, strict=False) if not only_model else self.model.load_state_dict(
|
||||
sd, strict=False)
|
||||
@@ -386,7 +386,7 @@ class DDPM(pl.LightningModule):
|
||||
_, loss_dict_no_ema = self.shared_step(batch)
|
||||
with self.ema_scope():
|
||||
_, loss_dict_ema = self.shared_step(batch)
|
||||
loss_dict_ema = {key + '_ema': loss_dict_ema[key] for key in loss_dict_ema}
|
||||
loss_dict_ema = {f"{key}_ema": loss_dict_ema[key] for key in loss_dict_ema}
|
||||
self.log_dict(loss_dict_no_ema, prog_bar=False, logger=True, on_step=False, on_epoch=True)
|
||||
self.log_dict(loss_dict_ema, prog_bar=False, logger=True, on_step=False, on_epoch=True)
|
||||
|
||||
|
Reference in New Issue
Block a user