Skip to content

Commit bbbb88c

Browse files
Merge remote-tracking branch 'origin/vision-getters-return-flat' into data-dependent-inputs
2 parents 7615cc2 + 57ac726 commit bbbb88c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/transformers/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@
435435
_import_structure["model_debugging_utils"] = ["model_addition_debugger_context"]
436436
_import_structure["modeling_flash_attention_utils"] = []
437437
_import_structure["modeling_layers"] = ["GradientCheckpointingLayer"]
438+
_import_structure["modeling_multimodal_utils"] = []
438439
_import_structure["modeling_outputs"] = []
439440
_import_structure["modeling_rope_utils"] = ["ROPE_INIT_FUNCTIONS", "RopeParameters", "dynamic_rope_update"]
440441
_import_structure["modeling_utils"] = ["AttentionInterface", "PreTrainedModel"]

‎utils/modular_model_converter.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,9 +1038,8 @@ def replace_class_node(
10381038

10391039
# If we explicitly passed a new base with common suffix to an old base, it is for switching the prefix
10401040
# e.g. if the "natural" parent class is `PreTrainedModel` but we wanted to rename it to `PreTrainedVisionModel`
1041-
# A base the parent already has is listed again, not a replacement: keep it out of the suffix matching below.
1042-
# Otherwise `Child(Parent, MultimodalMixin)` swaps the parent's `GenerationMixin` for `MultimodalMixin`, as both
1043-
# end in `Mixin`, and listing `GenerationMixin` again on top would duplicate it
1041+
# A base the parent already has is listed again, not a replacement: keep it out of the suffix matching below,
1042+
# or `Child(Parent, MultimodalMixin)` swaps the parent's `GenerationMixin` for `MultimodalMixin` (same suffix)
10441043
original_bases = {get_full_attribute_name(k.value) for k in original_modeling_node.bases}
10451044
additional_bases = {
10461045
base for base in all_new_bases.keys() if base != original_super_class and base not in original_bases

0 commit comments

Comments
 (0)