From 279de3c3ffedcb1394518a8f1c950fa30f272390 Mon Sep 17 00:00:00 2001 From: Sai-Suraj-27 Date: Fri, 12 Apr 2024 01:13:01 +0530 Subject: [PATCH] fix: Replaced deprecated `logger.warn` with `logger.warning` (#7643) Fixed deprecated logger.warn with logger.warning. --- src/diffusers/loaders/unet.py | 2 +- src/diffusers/pipelines/pipeline_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diffusers/loaders/unet.py b/src/diffusers/loaders/unet.py index 8bbec26189b0..a099267f40b4 100644 --- a/src/diffusers/loaders/unet.py +++ b/src/diffusers/loaders/unet.py @@ -998,7 +998,7 @@ def from_single_file(cls, pretrained_model_link_or_path, **kwargs): if is_accelerate_available(): unexpected_keys = load_model_dict_into_meta(model, diffusers_format_checkpoint, dtype=torch_dtype) if len(unexpected_keys) > 0: - logger.warn( + logger.warning( f"Some weights of the model checkpoint were not used when initializing {cls.__name__}: \n {[', '.join(unexpected_keys)]}" ) diff --git a/src/diffusers/pipelines/pipeline_utils.py b/src/diffusers/pipelines/pipeline_utils.py index 9b34bda0b783..68433332546b 100644 --- a/src/diffusers/pipelines/pipeline_utils.py +++ b/src/diffusers/pipelines/pipeline_utils.py @@ -1816,7 +1816,7 @@ def from_pipe(cls, pipeline, **kwargs): ): original_class_obj[name] = component else: - logger.warn( + logger.warning( f"component {name} is not switched over to new pipeline because type does not match the expected." f" {name} is {type(component)} while the new pipeline expect {component_types[name]}." f" please pass the component of the correct type to the new pipeline. `from_pipe(..., {name}={name})`"