class_docstr: Uses the BERT tokenizr model and add some transformer encoder layers
class_docstr_tok: ["Uses","the","BERT","tokenizr","model","and","add","some","transformer","encoder","layers"]
code: def __init__(
      self,
      n_embed,
      n_layer,
      vocab_size=30522,
      max_seq_len=77,
      device="cuda",
      use_tokenizer=True,
      embedding_dropout=0.0,
  ):
      super().__init__()
      self.use_tknz_fn = use_tokenizer
      if self.use_tknz_fn:
          self.tknz_fn = BERTTokenizer(
              vq_interface=False, max_length=max_seq_len
          )
      self.device = device
      self.transformer = TransformerWrapper(
          num_tokens=vocab_size,
          max_seq_len=max_seq_len,
          attn_layers=Encoder(dim=n_embed, depth=n_layer),
          emb_dropout=embedding_dropout,
      )
  
imports: import torch
  import torch.nn
  from functools import partial
  import clip
  from einops import rearrange, repeat
  from transformers import CLIPTokenizer, CLIPTextModel
  import kornia
  from ldm.modules.x_transformer import Encoder, TransformerWrapper
label_desc: Use image node_id 1 to create a new BERTEmbedder object from inherited base classes: AbstractEncoder with example: obj = BERTEmbedder(n_embed, n_layer, vocab_size, max_seq_len, device, use_tokenizer, embedding_dropout)