def construct_blocks(self, config: MPTConfig) -> nn.ModuleList:
        """Construct the nn.ModuleList with the Transformer blocks.

        Args:
            config (MPTConfig): The configuration object.

        Returns:
            nn.ModuleList: The list of Transformer blocks.
        """
        block_args = self.extract_block_args(config.to_dict())
        self.kv_cache_layers = set()  # type: ignore
        self.blocks_fuse_norm_attn_norm = block_args.get(  # type: ignore
            'fuse_norm_attn_norm',
            False,
        )

        if config.block_overrides is not None:
            block_args_list = self._get_override_block_args_list(
                config,
                block_args,
            )
        else:
            block_args_list = [block_args for _ in range(config.n_layers)]

        return nn.ModuleList([
            self.block_class(
                device=config.init_device,
                **block_args_i,
            ) for block_args_i in block_args_list
        ])
Construct the nn.ModuleList with the Transformer blocks.

        Args:
            config (MPTConfig): The configuration object.

        Returns:
            nn.ModuleList: The list of Transformer blocks.
        
llmfoundry/models/mpt/modeling_mpt.py