Skip to content

Commit

Permalink
deprecate get_input_dims
Browse files Browse the repository at this point in the history
  • Loading branch information
teticio committed Apr 22, 2023
1 parent c52c738 commit 110c8a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion audiodiffusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# from diffusers import AudioDiffusionPipeline
from .pipeline_audio_diffusion import AudioDiffusionPipeline

VERSION = "1.5.2"
VERSION = "1.5.3"


class AudioDiffusion:
Expand Down
17 changes: 0 additions & 17 deletions audiodiffusion/pipeline_audio_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ def __init__(
super().__init__()
self.register_modules(unet=unet, scheduler=scheduler, mel=mel, vqvae=vqvae)

def get_input_dims(self) -> Tuple:
"""Returns dimension of input image
Returns:
`Tuple`: (height, width)
"""
input_module = self.vqvae if self.vqvae is not None else self.unet
# For backwards compatibility
sample_size = (
(input_module.sample_size, input_module.sample_size)
if type(input_module.sample_size) == int
else input_module.sample_size
)
return sample_size

def get_default_steps(self) -> int:
"""Returns default number of steps recommended for inference
Expand Down Expand Up @@ -131,8 +116,6 @@ def __call__(
# For backwards compatibility
if type(self.unet.sample_size) == int:
self.unet.sample_size = (self.unet.sample_size, self.unet.sample_size)
input_dims = self.get_input_dims()
self.mel.set_resolution(x_res=input_dims[1], y_res=input_dims[0])
if noise is None:
noise = torch.randn(
(
Expand Down

0 comments on commit 110c8a4

Please sign in to comment.