Skip to content

Commit

Permalink
Convert MusicLDM (huggingface#4579)
Browse files Browse the repository at this point in the history
* from audioldm

* fix vae

* move to new pipeline

* copied from audioldm

* remove redundant control flow

* iterate

* fix docstring

* finish pipeline

* tests: from audioldm2

* iterate

* finish fast tests

* finish slow integration tests

* add docs

* remove dtype test

* update toctree

* "copied from" in conversion (where possible)

* Update docs/source/en/api/pipelines/musicldm.md

Co-authored-by: Patrick von Platen <[email protected]>

* fix docstring

* make nightly

* style

* fix dtype test

---------

Co-authored-by: Patrick von Platen <[email protected]>
  • Loading branch information
sanchit-gandhi and patrickvonplaten authored Aug 25, 2023
1 parent 9b0d751 commit e3e3083
Show file tree
Hide file tree
Showing 5 changed files with 641 additions and 0 deletions.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
KandinskyV22PriorEmb2EmbPipeline,
KandinskyV22PriorPipeline,
LDMTextToImagePipeline,
MusicLDMPipeline,
PaintByExamplePipeline,
SemanticStableDiffusionPipeline,
ShapEImg2ImgPipeline,
Expand Down
1 change: 1 addition & 0 deletions pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
KandinskyV22PriorPipeline,
)
from .latent_diffusion import LDMTextToImagePipeline
from .musicldm import MusicLDMPipeline
from .paint_by_example import PaintByExamplePipeline
from .semantic_stable_diffusion import SemanticStableDiffusionPipeline
from .shap_e import ShapEImg2ImgPipeline, ShapEPipeline
Expand Down
17 changes: 17 additions & 0 deletions pipelines/musicldm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ...utils import (
OptionalDependencyNotAvailable,
is_torch_available,
is_transformers_available,
is_transformers_version,
)


try:
if not (is_transformers_available() and is_torch_available() and is_transformers_version(">=", "4.27.0")):
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
from ...utils.dummy_torch_and_transformers_objects import (
MusicLDMPipeline,
)
else:
from .pipeline_musicldm import MusicLDMPipeline
Loading

0 comments on commit e3e3083

Please sign in to comment.