From 3b3f41cef180e2581cec2cde0579c491b18a74b9 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Wed, 8 Jul 2026 13:04:39 +0200 Subject: [PATCH 1/3] CI Pin huggingface_hub to < 1.22 See internal discussion, #3394, #3399, #3404 There are several issues since the huggingface_hub 1.22 release with loading Diffusers models on Windows. For the time being, we need to pin the version to < 1.22 and wait if/how this is resolved in hfh and Diffusers. --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b32975190..9edeec266d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,9 @@ jobs: run: | python -m pip install --upgrade pip pip install .[dev] + # 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: Check quality run: | make quality From af90bba7d2d9b0caa25b2ce19f4964626e0740dd Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Wed, 8 Jul 2026 13:07:44 +0200 Subject: [PATCH 2/3] Remove test skip logic from #3394 It's not needed with hfh < 1.22 --- tests/test_stablediffusion.py | 9 --------- tests/test_tuners_utils.py | 9 --------- 2 files changed, 18 deletions(-) diff --git a/tests/test_stablediffusion.py b/tests/test_stablediffusion.py index d25aa18173..213527c289 100644 --- a/tests/test_stablediffusion.py +++ b/tests/test_stablediffusion.py @@ -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 @@ -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 = [ ( @@ -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) diff --git a/tests/test_tuners_utils.py b/tests/test_tuners_utils.py index 9476bc8700..aea824907d 100644 --- a/tests/test_tuners_utils.py +++ b/tests/test_tuners_utils.py @@ -15,8 +15,6 @@ import re from copy import deepcopy -import diffusers -import packaging.version import pytest import torch from diffusers import StableDiffusionPipeline @@ -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 @@ -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) From fb0a95cfd105ff15c401edee727ddb7918d43218 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Wed, 8 Jul 2026 13:46:12 +0200 Subject: [PATCH 3/3] Move hfh install to correct workflow step --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9edeec266d..b483f6d745 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,9 +35,6 @@ jobs: run: | python -m pip install --upgrade pip pip install .[dev] - # 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: Check quality run: | make quality @@ -132,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: