Skip to content

Commit 585fed4

Browse files
committed
add warning messages.
1 parent d1b1bcd commit 585fed4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/diffusers/pipelines/pipeline_flax_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
312312
>>> dpm_params["scheduler"] = dpmpp_state
313313
```
314314
"""
315+
logger.warning(
316+
"Flax classes are deprecated and will be removed in Diffusers v1. We "
317+
"recommend migrating to PyTorch classes or pinning your version of Diffusers."
318+
)
319+
315320
cache_dir = kwargs.pop("cache_dir", None)
316321
proxies = kwargs.pop("proxies", None)
317322
local_files_only = kwargs.pop("local_files_only", False)

src/diffusers/schedulers/scheduling_utils_flax.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
import jax.numpy as jnp
2323
from huggingface_hub.utils import validate_hf_hub_args
2424

25-
from ..utils import BaseOutput, PushToHubMixin
25+
from ..utils import BaseOutput, PushToHubMixin, logging
2626

2727

28+
logger = logging.get_logger(__name__)
29+
2830
SCHEDULER_CONFIG_NAME = "scheduler_config.json"
2931

3032

@@ -133,6 +135,10 @@ def from_pretrained(
133135
</Tip>
134136
135137
"""
138+
logger.warning(
139+
"Flax classes are deprecated and will be removed in Diffusers v1. We "
140+
"recommend migrating to PyTorch classes or pinning your version of Diffusers."
141+
)
136142
config, kwargs = cls.load_config(
137143
pretrained_model_name_or_path=pretrained_model_name_or_path,
138144
subfolder=subfolder,

0 commit comments

Comments
 (0)