1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00
This commit is contained in:
DN6
2025-10-21 11:15:12 +05:30
parent 6a0a3c0462
commit 027e387bb1

View File

@@ -14,10 +14,10 @@ from packaging import version
# "transformers_version": (">=", "5.0.0"), # (operation, version) tuple
# }
# }
TRANSFORMERS_CLASS_REMAPPING = {
_TRANSFORMERS_CLASS_REMAPPING = {
"CLIPFeatureExtractor": {
"new_class": "CLIPImageProcessor",
"transformers_version": (">=", "4.57.0"),
"transformers_version": (">", "4.57.0"),
},
}
@@ -32,12 +32,12 @@ def _should_remap_transformers_class(class_name: str) -> Optional[str]:
Returns:
The new class name if remapping should occur, None otherwise
"""
if class_name not in TRANSFORMERS_CLASS_REMAPPING:
if class_name not in _TRANSFORMERS_CLASS_REMAPPING:
return None
from .import_utils import is_transformers_version
mapping = TRANSFORMERS_CLASS_REMAPPING[class_name]
mapping = _TRANSFORMERS_CLASS_REMAPPING[class_name]
operation, required_version = mapping["transformers_version"]
# Only remap if the transformers version meets the requirement