"""InDIM configuration: ModernBERT with a factorized (ALBERT-style) word embedding. InDIM-small (32M) keeps a 128,064 x 128 word table and projects it to the 384-wide encoder; the masked-LM output layer reuses the same table (tied). Everything else is the ModernBERT encoder as in `transformers`. """ from transformers import ModernBertConfig class InDIMConfig(ModernBertConfig): model_type = "indim" def __init__(self, embedding_rank=128, **kwargs): super().__init__(**kwargs) self.embedding_rank = embedding_rank