code: def __init__(
      self,
      model_name_or_path: str,
      embedding_type: str,
      layers: List[int] = None,
  ) -> None:
      super().__init__()
      self.config = AutoConfig.from_pretrained(
          model_name_or_path, output_hidden_states=True
      )
      self.model = AutoModel.from_pretrained(
          model_name_or_path, config=self.config
      )
      self.emb_type = embedding_type
      self.hs_emb = partial(
          hidden_state_embedding,
          layers=layers,
          use_cls=embedding_type.endswith("cls"),
      )
  
file_path: alibi-detect/alibi_detect/models/pytorch/embedding.py
imports: from functools import partial
  import torch
  import torch.nn
  from transformers import AutoModel, AutoConfig
  from typing import Dict, List
label_desc: Use image node_id 1 to create a new TransformerEmbedding object from inherited base classes: nn with example: obj = TransformerEmbedding(model_name_or_path, embedding_type, layers)