def modules_to_freeze(self) -> Union[Module, Iterable[Union[Module, Iterable]]]:
        """Return the module attributes of the model to be frozen."""
        model_type = self.model.config.model_type

        _modules = []

        is_t5 = model_type in ["t5", "mt5"]
        model = self.model if is_t5 else self.model.model
        _modules.append(model.shared)
        for layer in (model.encoder, model.decoder):
            _modules.append(layer.embed_tokens)
            if not is_t5:
                _modules.append(layer.embed_positions)
        return _modules
Return the module attributes of the model to be frozen.
src/flash/text/seq2seq/core/model.py