Skip to content

Commit

Permalink
Bump to v0.5.0dev0
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten committed Oct 7, 2022
1 parent 91ddd2a commit 9a95414
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 36 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def run(self):

setup(
name="diffusers",
version="0.4.1", # 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.5.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
Expand Up @@ -9,7 +9,7 @@
)


__version__ = "0.4.1"
__version__ = "0.5.0.dev0"

from .configuration_utils import ConfigMixin
from .onnx_utils import OnnxRuntimeModel
Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/schedulers/scheduling_ddim.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down Expand Up @@ -192,7 +192,7 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
the number of diffusion steps used when generating samples with a pre-trained model.
"""
deprecated_offset = deprecate(
"offset", "0.5.0", "Please pass `steps_offset` to `__init__` instead.", take_from=kwargs
"offset", "0.7.0", "Please pass `steps_offset` to `__init__` instead.", take_from=kwargs
)
offset = deprecated_offset or self.config.steps_offset

Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_karras_ve.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down
6 changes: 3 additions & 3 deletions src/diffusers/schedulers/scheduling_lms_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down Expand Up @@ -217,7 +217,7 @@ def step(
):
deprecate(
"timestep as an index",
"0.5.0",
"0.7.0",
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.step()` will not be supported in future versions. Make sure to pass"
" one of the `scheduler.timesteps` as a timestep.",
Expand Down Expand Up @@ -263,7 +263,7 @@ def add_noise(
if isinstance(timesteps, torch.IntTensor) or isinstance(timesteps, torch.LongTensor):
deprecate(
"timesteps as indices",
"0.5.0",
"0.7.0",
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.add_noise()` will not be supported in future versions. Make sure to"
" pass values from `scheduler.timesteps` as timesteps.",
Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/schedulers/scheduling_pndm.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down Expand Up @@ -159,7 +159,7 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
the number of diffusion steps used when generating samples with a pre-trained model.
"""
deprecated_offset = deprecate(
"offset", "0.5.0", "Please pass `steps_offset` to `__init__` instead.", take_from=kwargs
"offset", "0.7.0", "Please pass `steps_offset` to `__init__` instead.", take_from=kwargs
)
offset = deprecated_offset or self.config.steps_offset

Expand Down
14 changes: 1 addition & 13 deletions src/diffusers/schedulers/scheduling_sde_ve.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down Expand Up @@ -156,18 +156,13 @@ def get_adjacent_sigma(self, timesteps, t):
self.discrete_sigmas[timesteps - 1].to(timesteps.device),
)

def set_seed(self, seed):
deprecate("set_seed", "0.5.0", "Please consider passing a generator instead.")
torch.manual_seed(seed)

def step_pred(
self,
model_output: torch.FloatTensor,
timestep: int,
sample: torch.FloatTensor,
generator: Optional[torch.Generator] = None,
return_dict: bool = True,
**kwargs,
) -> Union[SdeVeOutput, Tuple]:
"""
Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
Expand All @@ -186,9 +181,6 @@ def step_pred(
`return_dict` is True, otherwise a `tuple`. When returning a tuple, the first element is the sample tensor.
"""
if "seed" in kwargs and kwargs["seed"] is not None:
self.set_seed(kwargs["seed"])

if self.timesteps is None:
raise ValueError(
"`self.timesteps` is not set, you need to run 'set_timesteps' after creating the scheduler"
Expand Down Expand Up @@ -231,7 +223,6 @@ def step_correct(
sample: torch.FloatTensor,
generator: Optional[torch.Generator] = None,
return_dict: bool = True,
**kwargs,
) -> Union[SchedulerOutput, Tuple]:
"""
Correct the predicted sample based on the output model_output of the network. This is often run repeatedly
Expand All @@ -249,9 +240,6 @@ def step_correct(
`return_dict` is True, otherwise a `tuple`. When returning a tuple, the first element is the sample tensor.
"""
if "seed" in kwargs and kwargs["seed"] is not None:
self.set_seed(kwargs["seed"])

if self.timesteps is None:
raise ValueError(
"`self.timesteps` is not set, you need to run 'set_timesteps' after creating the scheduler"
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_sde_vp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ScoreSdeVpScheduler(SchedulerMixin, ConfigMixin):
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3, **kwargs):
deprecate(
"tensor_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this argument.",
take_from=kwargs,
)
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/schedulers/scheduling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SchedulerMixin:
def set_format(self, tensor_format="pt"):
deprecate(
"set_format",
"0.5.0",
"0.6.0",
"If you're running your code in PyTorch, you can safely remove this function as the schedulers are always"
" in Pytorch",
)
Expand Down
10 changes: 0 additions & 10 deletions src/diffusers/schedulers/scheduling_utils_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
from dataclasses import dataclass

import jax.numpy as jnp
Expand Down Expand Up @@ -42,12 +41,3 @@ class FlaxSchedulerMixin:
"""

config_name = SCHEDULER_CONFIG_NAME

def set_format(self, tensor_format="pt"):
warnings.warn(
"The method `set_format` is deprecated and will be removed in version `0.5.0`."
"If you're running your code in PyTorch, you can safely remove this function as the schedulers"
"are always in Pytorch",
DeprecationWarning,
)
return self

0 comments on commit 9a95414

Please sign in to comment.