Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ jobs:
pip install setuptools
# cpu version of pytorch
pip install -e .[test]
# TODO see internal discussions about Diffusers/HFH issue, check around ~2025-09-01 if issue is resolved and
# pin can be removed
pip install "huggingface_hub<1.22"
- name: Test with pytest
shell: bash
env:
Expand Down
9 changes: 0 additions & 9 deletions tests/test_stablediffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
import copy
from dataclasses import asdict, replace

import diffusers
import numpy as np
import packaging.version
import pytest
import torch
from diffusers import AutoModel, StableDiffusionPipeline
Expand All @@ -41,10 +39,6 @@
from .testing_utils import hub_online_once, set_init_weights_false, temp_seed


# TODO: remove once Diffusers 0.40 is released
is_diffusers_ge_v040 = packaging.version.parse(diffusers.__version__) >= packaging.version.parse("0.40.0.dev0")


PEFT_DIFFUSERS_SD_MODELS_TO_TEST = ["hf-internal-testing/tiny-sd-pipe"]
DIFFUSERS_CONFIGS = [
(
Expand Down Expand Up @@ -354,9 +348,6 @@ def test_add_weighted_adapter_base_unchanged(self, model_id, config_cls, config_
@pytest.mark.parametrize("model_id", PEFT_DIFFUSERS_SD_MODELS_TO_TEST)
@pytest.mark.parametrize("config_cls,config_kwargs", DIFFUSERS_CONFIGS)
def test_disable_adapter(self, model_id, config_cls, config_kwargs):
# TODO: remove once Diffusers 0.40 is released
if not is_diffusers_ge_v040:
pytest.skip("This test fails with Diffusers < 0.40 due to a change in huggingface_hub")
config_kwargs = set_init_weights_false(config_cls, config_kwargs)
self._test_disable_adapter(model_id, config_cls, config_kwargs)

Expand Down
9 changes: 0 additions & 9 deletions tests/test_tuners_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import re
from copy import deepcopy

import diffusers
import packaging.version
import pytest
import torch
from diffusers import StableDiffusionPipeline
Expand Down Expand Up @@ -61,9 +59,6 @@
from .testing_utils import hub_online_once, require_bitsandbytes, require_non_cpu


# TODO: remove once Diffusers 0.40 is released
is_diffusers_ge_v040 = packaging.version.parse(diffusers.__version__) >= packaging.version.parse("0.40.0.dev0")

# Implements tests for regex matching logic common for all BaseTuner subclasses, and
# tests for correct behaviour with different config kwargs for BaseTuners (Ex: feedforward for IA3, etc) and
# tests for utility function to include all linear layers
Expand Down Expand Up @@ -345,10 +340,6 @@ def test_maybe_include_all_linear_layers_internals(self, initial_target_modules,
assert new_config.target_modules == expected_target_modules

def test_maybe_include_all_linear_layers_diffusion(self):
# TODO: remove once Diffusers 0.40 is released
if not is_diffusers_ge_v040:
pytest.skip("This test fails with Diffusers < 0.40 due to a change in huggingface_hub")

model_id = "hf-internal-testing/tiny-sd-pipe"
with hub_online_once(model_id):
model = StableDiffusionPipeline.from_pretrained(model_id)
Expand Down
Loading