Skip to content

Commit

Permalink
fix: Replaced deprecated logger.warn with logger.warning (#7643)
Browse files Browse the repository at this point in the history
Fixed deprecated logger.warn with logger.warning.
  • Loading branch information
Sai-Suraj-27 authored Apr 11, 2024
1 parent 8e14535 commit 279de3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/diffusers/loaders/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]}"
)

Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})`"
Expand Down

0 comments on commit 279de3c

Please sign in to comment.