Skip to content

Commit 1c4eb8c

Browse files
committed
Replace deprecation warning f-string with class name.
When `__repr__` is invoked in the instance serialization of `config_dict` fails, because it contains `kwargs` of type `<class inspect._empty>`.
1 parent d8572f2 commit 1c4eb8c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060

6161
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
6262
warnings.warn(
63-
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
63+
f"The configuration file of the {scheduler.__class__.__name__} scheduler is outdated. `steps_offset`"
6464
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
6565
"to update the config accordingly as leaving `steps_offset` might led to incorrect results"
6666
" in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,"

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(
7272

7373
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
7474
warnings.warn(
75-
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
75+
f"The configuration file of the {scheduler.__class__.__name__} scheduler is outdated. `steps_offset`"
7676
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
7777
"to update the config accordingly as leaving `steps_offset` might led to incorrect results"
7878
" in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,"

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787

8888
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
8989
warnings.warn(
90-
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
90+
f"The configuration file of the {scheduler.__class__.__name__} scheduler is outdated. `steps_offset`"
9191
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
9292
"to update the config accordingly as leaving `steps_offset` might led to incorrect results"
9393
" in future versions. If you have downloaded this checkpoint from the Hugging Face Hub,"

0 commit comments

Comments
 (0)