class_docstr: Adds adapters to the Attention module of GPT2.
class_docstr_tok: ["Adds","adapters","to","the","Attention","module","of","GPT2","."]
code: def init_adapters(self, model_config, adapters_config):
      # Wrap layers for LoRA
      if not self.is_cross_attention:
          self.c_attn = LoRAMergedLinear.wrap(
              self.c_attn,
              "selfattn",
              model_config,
              adapters_config,
              fan_in_fan_out=True,
              no_init_bias=True,
          )
  
      location_key = (
          "cross_prefix" if self.is_cross_attention else "self_prefix"
      )
      self.prefix_tuning = PrefixTuningLayer(
          location_key, model_config, adapters_config
      )
  
file_path: adapters/src/adapters/models/gpt2/mixin_gpt2.py
imports: from typing import Iterable, Tuple
  import torch.nn
  from ...methods.bottleneck import BottleneckLayer
  from ...methods.lora import LoRALinear, LoRAMergedLinear
  from ...methods.prefix_tuning import PrefixTuningLayer
  from ...model_mixin import EmbeddingAdaptersMixin, InvertibleAdaptersMixin, ModelBaseAdaptersMixin
label_desc: Use image node_id 1 for calling the GPT2AttentionAdaptersMixin obj's underlying member method code with example usage: obj.init_adapters(model_config, adapters_config) without return types