File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ]
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments