diff --git a/src/diffusers/loaders/lora_base.py b/src/diffusers/loaders/lora_base.py index 16f0d4836505..e6941a521d06 100644 --- a/src/diffusers/loaders/lora_base.py +++ b/src/diffusers/loaders/lora_base.py @@ -1022,15 +1022,3 @@ def save_function(weights, filename): @classmethod def _optionally_disable_offloading(cls, _pipeline): return _func_optionally_disable_offloading(_pipeline=_pipeline) - - @classmethod - def _fetch_state_dict(cls, *args, **kwargs): - deprecation_message = f"Using the `_fetch_state_dict()` method from {cls} has been deprecated and will be removed in a future version. Please use `from diffusers.loaders.lora_base import _fetch_state_dict`." - deprecate("_fetch_state_dict", "0.35.0", deprecation_message) - return _fetch_state_dict(*args, **kwargs) - - @classmethod - def _best_guess_weight_name(cls, *args, **kwargs): - deprecation_message = f"Using the `_best_guess_weight_name()` method from {cls} has been deprecated and will be removed in a future version. Please use `from diffusers.loaders.lora_base import _best_guess_weight_name`." - deprecate("_best_guess_weight_name", "0.35.0", deprecation_message) - return _best_guess_weight_name(*args, **kwargs) diff --git a/tests/lora/test_deprecated_utilities.py b/tests/lora/test_deprecated_utilities.py deleted file mode 100644 index 4275ef8089a3..000000000000 --- a/tests/lora/test_deprecated_utilities.py +++ /dev/null @@ -1,39 +0,0 @@ -import os -import tempfile -import unittest - -import torch - -from diffusers.loaders.lora_base import LoraBaseMixin - - -class UtilityMethodDeprecationTests(unittest.TestCase): - def test_fetch_state_dict_cls_method_raises_warning(self): - state_dict = torch.nn.Linear(3, 3).state_dict() - with self.assertWarns(FutureWarning) as warning: - _ = LoraBaseMixin._fetch_state_dict( - state_dict, - weight_name=None, - use_safetensors=False, - local_files_only=True, - cache_dir=None, - force_download=False, - proxies=None, - token=None, - revision=None, - subfolder=None, - user_agent=None, - allow_pickle=None, - ) - warning_message = str(warning.warnings[0].message) - assert "Using the `_fetch_state_dict()` method from" in warning_message - - def test_best_guess_weight_name_cls_method_raises_warning(self): - with tempfile.TemporaryDirectory() as tmpdir: - state_dict = torch.nn.Linear(3, 3).state_dict() - torch.save(state_dict, os.path.join(tmpdir, "pytorch_lora_weights.bin")) - - with self.assertWarns(FutureWarning) as warning: - _ = LoraBaseMixin._best_guess_weight_name(pretrained_model_name_or_path_or_dict=tmpdir) - warning_message = str(warning.warnings[0].message) - assert "Using the `_best_guess_weight_name()` method from" in warning_message