Skip to content

Commit 555a5ae

Browse files
committed
config_dict modification.
1 parent 510d57a commit 555a5ae

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/diffusers/configuration_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ def extract_init_dict(cls, config_dict, **kwargs):
510510
# remove private attributes
511511
config_dict = {k: v for k, v in config_dict.items() if not k.startswith("_")}
512512

513+
# remove quantization_config
514+
config_dict = {k: v for k, v in config_dict.items() if k != "quantization_config"}
515+
513516
# 3. Create keyword arguments that will be passed to __init__ from expected keyword arguments
514517
init_dict = {}
515518
for key in expected_keys:
@@ -526,8 +529,7 @@ def extract_init_dict(cls, config_dict, **kwargs):
526529
init_dict[key] = config_dict.pop(key)
527530

528531
# 4. Give nice warning if unexpected values have been passed
529-
only_quant_config_remaining = len(config_dict) == 1 and "quantization_config" in config_dict
530-
if len(config_dict) > 0 and not only_quant_config_remaining:
532+
if len(config_dict) > 0:
531533
logger.warning(
532534
f"The config attributes {config_dict} were passed to {cls.__name__}, "
533535
"but are not expected and will be ignored. Please verify your "

src/diffusers/utils/testing_utils.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,6 @@ def decorator(test_case):
447447
return decorator
448448

449449

450-
def require_transformers_version_greater(transformers_version):
451-
def decorator(test_case):
452-
correct_transformers_version = is_transformers_available() and version.parse(
453-
version.parse(importlib.metadata.version("transformers")).base_version
454-
) > version.parse(transformers_version)
455-
return unittest.skipUnless(
456-
correct_transformers_version,
457-
f"test requires transformers backend with the version greater than {transformers_version}",
458-
)(test_case)
459-
460-
return decorator
461-
462-
463450
def deprecate_after_peft_backend(test_case):
464451
"""
465452
Decorator marking a test that will be skipped after PEFT backend

0 commit comments

Comments
 (0)