Skip to content

Commit

Permalink
post release v0.23.0 (huggingface#5730)
Browse files Browse the repository at this point in the history
* post release

* fix: variant test

* up

* fix: test
  • Loading branch information
sayakpaul authored Nov 10, 2023
1 parent 1f87f83 commit 1477865
Show file tree
Hide file tree
Showing 28 changed files with 33 additions and 47 deletions.
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/custom_diffusion/train_custom_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

# Cache compiled models across invocations of this script.
cc.initialize_cache(os.path.expanduser("~/.cache/jax/compilation_cache"))
Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/t2i_adapter/train_t2i_adapter_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_lora_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/textual_inversion/textual_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/textual_inversion/textual_inversion_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# ------------------------------------------------------------------------------

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.23.0.dev0")
check_min_version("0.24.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def run(self):

setup(
name="diffusers",
version="0.23.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)
version="0.24.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="State-of-the-art diffusion in PyTorch and JAX.",
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.23.0.dev0"
__version__ = "0.24.0.dev0"

from typing import TYPE_CHECKING

Expand Down
26 changes: 6 additions & 20 deletions tests/pipelines/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.

import gc
import glob
import json
import os
import random
Expand Down Expand Up @@ -57,7 +56,7 @@
UniPCMultistepScheduler,
logging,
)
from diffusers.pipelines.pipeline_utils import _get_pipeline_class, variant_compatible_siblings
from diffusers.pipelines.pipeline_utils import _get_pipeline_class
from diffusers.schedulers.scheduling_utils import SCHEDULER_CONFIG_NAME
from diffusers.utils import (
CONFIG_NAME,
Expand Down Expand Up @@ -1505,28 +1504,15 @@ def test_name_or_path(self):

assert sd.name_or_path == tmpdirname

def test_warning_no_variant_available(self):
def test_error_no_variant_available(self):
variant = "fp16"
with self.assertWarns(FutureWarning) as warning_context:
cached_folder = StableDiffusionPipeline.download(
with self.assertRaises(ValueError) as error_context:
_ = StableDiffusionPipeline.download(
"hf-internal-testing/diffusers-stable-diffusion-tiny-all", variant=variant
)

assert "but no such modeling files are available" in str(warning_context.warning)
assert variant in str(warning_context.warning)

def get_all_filenames(directory):
filenames = glob.glob(directory + "/**", recursive=True)
filenames = [f for f in filenames if os.path.isfile(f)]
return filenames

filenames = get_all_filenames(str(cached_folder))

all_model_files, variant_model_files = variant_compatible_siblings(filenames, variant=variant)

# make sure that none of the model names are variant model names
assert len(variant_model_files) == 0
assert len(all_model_files) > 0
assert "but no such modeling files are available" in str(error_context.exception)
assert variant in str(error_context.exception)

def test_pipe_to(self):
unet = self.dummy_cond_unet()
Expand Down

0 comments on commit 1477865

Please sign in to comment.