Skip to content

Commit

Permalink
Bump to 0.12.0.dev0 (huggingface#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-l authored Dec 19, 2022
1 parent f1a3220 commit 8331da4
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion examples/community/imagic_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def train(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

accelerator = Accelerator(
Expand Down
2 changes: 1 addition & 1 deletion examples/community/lpw_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 0. Default height and width to unet
Expand Down
2 changes: 1 addition & 1 deletion examples/community/lpw_stable_diffusion_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 0. Default height and width to unet
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def run(self):

setup(
name="diffusers",
version="0.11.0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
version="0.12.0.dev0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
description="Diffusers",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.11.0"
__version__ = "0.12.0.dev0"

from .configuration_utils import ConfigMixin
from .onnx_utils import OnnxRuntimeModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 1. Check inputs
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/pipelines/ddim/pipeline_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __call__(
)
deprecate(
"generator.device == 'cpu'",
"0.12.0",
"0.13.0",
message,
)
generator = None
Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/pipelines/ddpm/pipeline_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __call__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)

if predict_epsilon is not None:
new_config = dict(self.scheduler.config)
Expand All @@ -88,7 +88,7 @@ def __call__(
)
deprecate(
"generator.device == 'cpu'",
"0.12.0",
"0.13.0",
message,
)
generator = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __call__(
generated images.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

if isinstance(image, PIL.Image.Image):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 1. Check inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

if isinstance(prompt, str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

if isinstance(prompt, str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 1. Check inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def __call__(
(nsfw) content, according to the `safety_checker`.
"""
message = "Please use `image` instead of `init_image`."
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
init_image = deprecate("init_image", "0.13.0", message, take_from=kwargs)
image = init_image or image

# 1. Check inputs
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DDIMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_ddim_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" FlaxDDIMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/schedulers/scheduling_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down Expand Up @@ -256,7 +256,7 @@ def step(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
new_config = dict(self.config)
new_config["prediction_type"] = "epsilon" if predict_epsilon else "sample"
Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/schedulers/scheduling_ddpm_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" FlaxDDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down Expand Up @@ -239,7 +239,7 @@ def step(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" FlaxDDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
new_config = dict(self.config)
new_config["prediction_type"] = "epsilon" if predict_epsilon else "sample"
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_dpmsolver_multistep.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DPMSolverMultistepScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(
"Please make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" FlaxDPMSolverMultistepScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon = deprecate("predict_epsilon", "0.12.0", message, take_from=kwargs)
predict_epsilon = deprecate("predict_epsilon", "0.13.0", message, take_from=kwargs)
if predict_epsilon is not None:
self.register_to_config(prediction_type="epsilon" if predict_epsilon else "sample")

Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/ddpm/test_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_inference(self):
assert np.abs(image_from_tuple_slice.flatten() - expected_slice).max() < 1e-2

def test_inference_deprecated_predict_epsilon(self):
deprecate("remove this test", "0.12.0", "remove")
deprecate("remove this test", "0.13.0", "remove")
unet = self.dummy_uncond_unet
scheduler = DDPMScheduler(predict_epsilon=False)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_overwrite_config_on_load(self):
ddpm_2 = DDPMScheduler.from_pretrained("google/ddpm-celebahq-256", beta_start=88)

with CaptureLogger(logger) as cap_logger:
deprecate("remove this case", "0.12.0", "remove")
deprecate("remove this case", "0.13.0", "remove")
ddpm_3 = DDPMScheduler.from_pretrained(
"hf-internal-testing/tiny-stable-diffusion-torch",
subfolder="scheduler",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,12 @@ def test_prediction_type(self):
self.check_over_configs(prediction_type=prediction_type)

def test_deprecated_predict_epsilon(self):
deprecate("remove this test", "0.12.0", "remove")
deprecate("remove this test", "0.13.0", "remove")
for predict_epsilon in [True, False]:
self.check_over_configs(predict_epsilon=predict_epsilon)

def test_deprecated_epsilon(self):
deprecate("remove this test", "0.12.0", "remove")
deprecate("remove this test", "0.13.0", "remove")
scheduler_class = self.scheduler_classes[0]
scheduler_config = self.get_scheduler_config()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_scheduler_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,12 @@ def test_prediction_type(self):
self.check_over_configs(prediction_type=prediction_type)

def test_deprecated_predict_epsilon(self):
deprecate("remove this test", "0.12.0", "remove")
deprecate("remove this test", "0.13.0", "remove")
for predict_epsilon in [True, False]:
self.check_over_configs(predict_epsilon=predict_epsilon)

def test_deprecated_predict_epsilon_to_prediction_type(self):
deprecate("remove this test", "0.12.0", "remove")
deprecate("remove this test", "0.13.0", "remove")
for scheduler_class in self.scheduler_classes:
scheduler_config = self.get_scheduler_config(predict_epsilon=True)
scheduler = scheduler_class.from_config(scheduler_config)
Expand Down

0 comments on commit 8331da4

Please sign in to comment.