code: def get_mean_embeds(self, class_names, name="default"):
      def extract_mean_emb(txts):
          tokens = self.tokenizer(
              txts,
              padding="max_length",
              truncation=True,
              max_length=self.max_token_num,
              return_tensors="pt",
          )
          clss_embedding, _ = self.forward_language(
              (
                  tokens["input_ids"].cuda(),
                  tokens["attention_mask"].cuda(),
              ),
              norm=True,
              with_token_embed=False,
          )
          clss_embedding = clss_embedding.mean(dim=0)
          clss_embedding /= clss_embedding.norm()
          return clss_embedding
  
      templates = get_prompt_templates()
  
      clss_embeddings = []
      for clss in class_names:
          txts = [
              template.format(
                  clss.replace("-other", "")
                  .replace("-merged", "")
                  .replace("-stuff", "")
              )
              for template in templates
          ]
          clss_embeddings.append(extract_mean_emb(txts))
  
      text_emb = torch.stack(clss_embeddings, dim=0)
      setattr(self, "{}_text_embeddings".format(name), text_emb)
  
imports: import os
  from collections import OrderedDict
  import torch
  from mmcv.cnn.bricks import DropPath
  from torch import nn
  from transformers import CLIPTokenizer
  from .utils import get_prompt_templates
label_desc: Use image node_id 2 for calling the LanguageEncoder obj's underlying member method code with example usage: obj.get_mean_embeds(class_names, name) and returns: clss_embedding