Skip to content

Commit b8905b9

Browse files
committed
Revert "deprecate dduf."
This reverts commit b3545f9.
1 parent b3545f9 commit b8905b9

3 files changed

Lines changed: 2 additions & 25 deletions

File tree

docs/source/en/using-diffusers/other-formats.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ pipeline = DiffusionPipeline.from_single_file(
220220

221221
### dduf
222222

223-
> [!WARNING]
224-
> DDUF support is deprecated and will be removed in version 0.41.0. Save and load your pipelines using the standard Diffusers directory format instead.
225-
226223
> [!TIP]
227224
> DDUF is an experimental file type and the API may change. Refer to the DDUF [docs](https://huggingface.co/docs/hub/dduf) to learn more.
228225

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
PushToHubMixin,
5959
_get_detailed_type,
6060
_is_valid_type,
61-
deprecate,
6261
is_accelerate_available,
6362
is_accelerate_version,
6463
is_bitsandbytes_version,
@@ -115,11 +114,6 @@
115114

116115
SUPPORTED_DEVICE_MAP = ["balanced"] + [get_device(), "cpu"]
117116

118-
_DDUF_DEPRECATION_MESSAGE = (
119-
"Loading pipelines from DDUF files is deprecated and DDUF support will be removed entirely. "
120-
"Please save and load your pipelines using the standard Diffusers directory format instead."
121-
)
122-
123117
logger = logging.get_logger(__name__)
124118

125119

@@ -736,8 +730,7 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike, **kwa
736730
Load weights from a specified variant filename such as `"fp16"` or `"ema"`. This is ignored when
737731
loading `from_flax`.
738732
dduf_file(`str`, *optional*):
739-
Load weights from the specified dduf file. <Deprecated> This argument is deprecated and will be removed
740-
in version 0.41.0. </Deprecated>
733+
Load weights from the specified dduf file.
741734
disable_mmap ('bool', *optional*, defaults to 'False'):
742735
Whether to disable mmap when loading a Safetensors model. This option can perform better when the model
743736
is on a network mount or hard drive, which may not handle the seeky-ness of mmap very well.
@@ -850,7 +843,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: str | os.PathLike, **kwa
850843
)
851844

852845
if dduf_file:
853-
deprecate("dduf_file", "0.41.0", _DDUF_DEPRECATION_MESSAGE)
854846
if custom_pipeline:
855847
raise NotImplementedError("Custom pipelines are not supported with DDUF at the moment.")
856848
if load_connected_pipeline:
@@ -1580,8 +1572,7 @@ def download(cls, pretrained_model_name, **kwargs) -> str | os.PathLike:
15801572
Load weights from a specified variant filename such as `"fp16"` or `"ema"`. This is ignored when
15811573
loading `from_flax`.
15821574
dduf_file(`str`, *optional*):
1583-
Load weights from the specified DDUF file. <Deprecated> This argument is deprecated and will be removed
1584-
in version 0.41.0. </Deprecated>
1575+
Load weights from the specified DDUF file.
15851576
use_safetensors (`bool`, *optional*, defaults to `None`):
15861577
If set to `None`, the safetensors weights are downloaded if they're available **and** if the
15871578
safetensors library is installed. If set to `True`, the model is forcibly loaded from safetensors
@@ -1625,7 +1616,6 @@ def download(cls, pretrained_model_name, **kwargs) -> str | os.PathLike:
16251616
use_flashpack = kwargs.pop("use_flashpack", False)
16261617

16271618
if dduf_file:
1628-
deprecate("dduf_file", "0.41.0", _DDUF_DEPRECATION_MESSAGE)
16291619
if custom_pipeline:
16301620
raise NotImplementedError("Custom pipelines are not supported with DDUF at the moment.")
16311621
if load_connected_pipeline:

tests/pipelines/test_pipelines.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,16 +2014,6 @@ def test_dduf_raises_error_with_connected_pipeline(self):
20142014
"DDUF/tiny-flux-dev-pipe-dduf", dduf_file="fluxpipeline.dduf", load_connected_pipeline=True
20152015
)
20162016

2017-
@require_hf_hub_version_greater("0.26.5")
2018-
@require_transformers_version_greater("4.47.1")
2019-
def test_dduf_file_is_deprecated(self):
2020-
with tempfile.TemporaryDirectory() as tmpdir:
2021-
with self.assertWarns(FutureWarning) as warning_ctx:
2022-
_ = DiffusionPipeline.from_pretrained(
2023-
"DDUF/tiny-flux-dev-pipe-dduf", dduf_file="fluxpipeline.dduf", cache_dir=tmpdir
2024-
)
2025-
assert "dduf_file" in str(warning_ctx.warning)
2026-
20272017
@pytest.mark.xfail(condition=is_transformers_version(">", "4.56.2"), reason="Some import error", strict=False)
20282018
def test_wrong_model(self):
20292019
tokenizer = CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip")

0 commit comments

Comments
 (0)