Skip to content
6 changes: 5 additions & 1 deletion src/transformers/models/chameleon/modeling_chameleon.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,11 @@ class ChameleonPreTrainedModel(PreTrainedModel):
)
class ChameleonVQVAE(ChameleonPreTrainedModel):
config: ChameleonVQVAEConfig
_no_split_modules = ["ChameleonVQVAEVectorQuantizer"]
_no_split_modules = [
"ChameleonVQVAEVectorQuantizer",
"ChameleonVQVAEEncoderAttnBlock",
"ChameleonVQVAEEncoderResnetBlock",
Comment on lines +822 to +823
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ! we can also put instead ChameleonVQVAEEncoder if these blocks are small enough

Copy link
Contributor Author

@yao-matrix yao-matrix Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems ChameleonVQVAEEncoder is a mega block w/ multiple ChameleonVQVAEEncoderResnetBlock, ChameleonVQVAEEncoderConvDownsample and ChameleonVQVAEEncoderAttnBlock(

class ChameleonVQVAEEncoder(nn.Module):
), so maybe better not to put ChameleonVQVAEEncoder

]

def __init__(self, config: ChameleonVQVAEConfig):
super().__init__(config)
Expand Down