Skip to content

Commit 409b0ac

Browse files
Bump to 0.6.0.dev0 (huggingface#831)
* Bump to 0.6.0.dev0 * Deprecate tensor_format and .samples * style * upd * upd * style * sample -> images * Update src/diffusers/schedulers/scheduling_ddpm.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_ddim.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_karras_ve.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_lms_discrete.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_pndm.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_sde_ve.py Co-authored-by: Patrick von Platen <[email protected]> * Update src/diffusers/schedulers/scheduling_sde_vp.py Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Patrick von Platen <[email protected]>
1 parent a83e276 commit 409b0ac

File tree

10 files changed

+6
-74
lines changed

10 files changed

+6
-74
lines changed

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
)
1010

1111

12-
__version__ = "0.5.1"
12+
__version__ = "0.6.0.dev0"
1313

1414
from .configuration_utils import ConfigMixin
1515
from .onnx_utils import OnnxRuntimeModel

schedulers/scheduling_ddim.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,7 @@ def __init__(
119119
clip_sample: bool = True,
120120
set_alpha_to_one: bool = True,
121121
steps_offset: int = 0,
122-
**kwargs,
123122
):
124-
deprecate(
125-
"tensor_format",
126-
"0.6.0",
127-
"If you're running your code in PyTorch, you can safely remove this argument.",
128-
take_from=kwargs,
129-
)
130-
131123
if trained_betas is not None:
132124
self.betas = torch.from_numpy(trained_betas)
133125
elif beta_schedule == "linear":

schedulers/scheduling_ddpm.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import torch
2323

2424
from ..configuration_utils import ConfigMixin, register_to_config
25-
from ..utils import BaseOutput, deprecate
25+
from ..utils import BaseOutput
2626
from .scheduling_utils import SchedulerMixin
2727

2828

@@ -112,15 +112,7 @@ def __init__(
112112
trained_betas: Optional[np.ndarray] = None,
113113
variance_type: str = "fixed_small",
114114
clip_sample: bool = True,
115-
**kwargs,
116115
):
117-
deprecate(
118-
"tensor_format",
119-
"0.6.0",
120-
"If you're running your code in PyTorch, you can safely remove this argument.",
121-
take_from=kwargs,
122-
)
123-
124116
if trained_betas is not None:
125117
self.betas = torch.from_numpy(trained_betas)
126118
elif beta_schedule == "linear":

schedulers/scheduling_karras_ve.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import torch
2121

2222
from ..configuration_utils import ConfigMixin, register_to_config
23-
from ..utils import BaseOutput, deprecate
23+
from ..utils import BaseOutput
2424
from .scheduling_utils import SchedulerMixin
2525

2626

@@ -86,15 +86,7 @@ def __init__(
8686
s_churn: float = 80,
8787
s_min: float = 0.05,
8888
s_max: float = 50,
89-
**kwargs,
9089
):
91-
deprecate(
92-
"tensor_format",
93-
"0.6.0",
94-
"If you're running your code in PyTorch, you can safely remove this argument.",
95-
take_from=kwargs,
96-
)
97-
9890
# standard deviation of the initial noise distribution
9991
self.init_noise_sigma = sigma_max
10092

schedulers/scheduling_lms_discrete.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,7 @@ def __init__(
7474
beta_end: float = 0.02,
7575
beta_schedule: str = "linear",
7676
trained_betas: Optional[np.ndarray] = None,
77-
**kwargs,
7877
):
79-
deprecate(
80-
"tensor_format",
81-
"0.6.0",
82-
"If you're running your code in PyTorch, you can safely remove this argument.",
83-
take_from=kwargs,
84-
)
85-
8678
if trained_betas is not None:
8779
self.betas = torch.from_numpy(trained_betas)
8880
elif beta_schedule == "linear":

schedulers/scheduling_pndm.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,7 @@ def __init__(
100100
skip_prk_steps: bool = False,
101101
set_alpha_to_one: bool = False,
102102
steps_offset: int = 0,
103-
**kwargs,
104103
):
105-
deprecate(
106-
"tensor_format",
107-
"0.6.0",
108-
"If you're running your code in PyTorch, you can safely remove this argument.",
109-
take_from=kwargs,
110-
)
111-
112104
if trained_betas is not None:
113105
self.betas = torch.from_numpy(trained_betas)
114106
elif beta_schedule == "linear":

schedulers/scheduling_sde_ve.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import torch
2222

2323
from ..configuration_utils import ConfigMixin, register_to_config
24-
from ..utils import BaseOutput, deprecate
24+
from ..utils import BaseOutput
2525
from .scheduling_utils import SchedulerMixin, SchedulerOutput
2626

2727

@@ -75,15 +75,7 @@ def __init__(
7575
sigma_max: float = 1348.0,
7676
sampling_eps: float = 1e-5,
7777
correct_steps: int = 1,
78-
**kwargs,
7978
):
80-
deprecate(
81-
"tensor_format",
82-
"0.6.0",
83-
"If you're running your code in PyTorch, you can safely remove this argument.",
84-
take_from=kwargs,
85-
)
86-
8779
# standard deviation of the initial noise distribution
8880
self.init_noise_sigma = sigma_max
8981

schedulers/scheduling_sde_vp.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import torch
2121

2222
from ..configuration_utils import ConfigMixin, register_to_config
23-
from ..utils import deprecate
2423
from .scheduling_utils import SchedulerMixin
2524

2625

@@ -40,13 +39,7 @@ class ScoreSdeVpScheduler(SchedulerMixin, ConfigMixin):
4039
"""
4140

4241
@register_to_config
43-
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3, **kwargs):
44-
deprecate(
45-
"tensor_format",
46-
"0.6.0",
47-
"If you're running your code in PyTorch, you can safely remove this argument.",
48-
take_from=kwargs,
49-
)
42+
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3):
5043
self.sigmas = None
5144
self.discrete_sigmas = None
5245
self.timesteps = None

schedulers/scheduling_utils.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import torch
1717

18-
from ..utils import BaseOutput, deprecate
18+
from ..utils import BaseOutput
1919

2020

2121
SCHEDULER_CONFIG_NAME = "scheduler_config.json"
@@ -41,12 +41,3 @@ class SchedulerMixin:
4141
"""
4242

4343
config_name = SCHEDULER_CONFIG_NAME
44-
45-
def set_format(self, tensor_format="pt"):
46-
deprecate(
47-
"set_format",
48-
"0.6.0",
49-
"If you're running your code in PyTorch, you can safely remove this function as the schedulers are always"
50-
" in Pytorch",
51-
)
52-
return self

utils/outputs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import numpy as np
2323

24-
from .deprecation_utils import deprecate
2524
from .import_utils import is_torch_available
2625

2726

@@ -86,9 +85,6 @@ def update(self, *args, **kwargs):
8685
def __getitem__(self, k):
8786
if isinstance(k, str):
8887
inner_dict = {k: v for (k, v) in self.items()}
89-
if self.__class__.__name__ in ["StableDiffusionPipelineOutput", "ImagePipelineOutput"] and k == "sample":
90-
deprecate("samples", "0.6.0", "Please use `.images` or `'images'` instead.")
91-
return inner_dict["images"]
9288
return inner_dict[k]
9389
else:
9490
return self.to_tuple()[k]

0 commit comments

Comments
 (0)