src/transformers/models/mvp/modeling_mvp.py/MvpModel/set_lightweight_tuning
class MvpModel:    def set_lightweight_tuning(self):
        assert self.use_prompt, "If you want to use lightweight tuning, make sure that `use_prompt=True`."

        self.requires_grad_(False)
        self.encoder.self_attn_prompt.requires_grad_(True)
        self.decoder.self_attn_prompt.requires_grad_(True)
        self.decoder.cross_attn_prompt.requires_grad_(True)