class_docstr: Simplified transformer wrapper.
class_docstr_tok: ["Simplified","transformer","wrapper","."]
code: def __init__(self, config):
      super().__init__(config)
      self.cfg = OmegaConf.create(config.arch)
  
      self.embedding = EmbeddingComponent(
          self.cfg.embedding, self.cfg.norm, self.cfg.norm_eps
      )
      self.layers = torch.nn.ModuleList(
          [
              TransformerLayer(idx, self.cfg)
              for idx in range(self.cfg.num_transformer_layers)
          ]
      )
      self.seq_first = (
          self.layers[0].LAYOUT == "[S B H]"
          if len(self.layers) > 0
          else False
      )
      self.use_causal_attention = self.cfg.attention.causal_attention
  
      if self.cfg.final_norm:
          self.final_norm = _get_norm_fn(self.cfg.norm)(
              self.cfg.hidden_size, eps=self.cfg.norm_eps
          )
      else:
          self.final_norm = torch.nn.Identity()
  
imports: import torch
  from transformers import PretrainedConfig, PreTrainedModel
  from transformers import AutoConfig, AutoModel, AutoModelForMaskedLM, AutoModelForSequenceClassification, AutoModelForTokenClassification
  from typing import Optional
  from omegaconf import OmegaConf
  from .fff import FFF
  from .components import _get_norm_fn, _get_nonlin_fn, EmbeddingComponent, PoolingComponent, PredictionHeadComponent, GLU, get_extended_attention_mask, _init_module
  from .attention import get_attention_mechanism
label_desc: Use image node_id 1 to create a new ScriptableLM object from inherited base classes: PreTrainedModel with example: obj = ScriptableLM(config)