class_docstr: MMT TXT Model
  Args:
      txt_bert (nn.Module): Bert model using for text
      tokenizer (Any): Tokenizer for input text
      max_length (int): text max length
      modalities (List): modalities name list
      add_special_tokens (bool): whether use special tokens
      add_dot (bool): add dot in the end of text
      same_dim (int): same dim in the dimension of output of GatedEmbeddingUnit
      dout_prob (float): dropout prob
code: def forward(self, text_list):
      if self.add_dot:
          text_list1 = []
          for x in text_list:
              x = x.strip()
              if x[-1] not in (".", "?", "!"):
                  x = x + "."
              text_list1.append(x)
          text_list = text_list1
      device = self.device
      encoded_inputs = self.tokenizer(
          text_list,
          max_length=self.max_length,
          truncation=True,
          add_special_tokens=self.add_special_tokens,
          padding=True,
          return_tensors="pt",
      )
      if self.orig_mmt_comaptible:
          encoded_inputs = {
              key: pad(value, self.max_length).to(device)
              for key, value in encoded_inputs.items()
          }
          encoded_inputs["head_mask"] = None
      else:
          encoded_inputs = {
              key: value.to(device)
              for key, value in encoded_inputs.items()
          }
      x = self.txt_bert(**encoded_inputs)[
          0
      ]  # (bs, max_tokens, hidden_size)
      # authors of MMT take token 0 and think that it is CLS
      # but they dont provide CLS token to input
      text = x[:, 0, :]
      text_embd = []
      for mod in self.modalities:
          layer = self.text_gu[mod]  # this layer containg F.normalize
          text_ = layer(text)  # (bs, d_model) this is unit-length embs
          if self.orig_mmt_comaptible:
              text_ = F.normalize(text_)
          text_ = text_.unsqueeze(1)  # (bs, 1, d_model)
          text_embd.append(text_)
      text_embd = torch.cat(text_embd, dim=1)  # (bs, nmods, d_model)
      if len(self.modalities) > 1:
          text_weights = self.compute_weights_from_emb(
              text
          )  # (bs, nmods)
          embd_wg = (
              text_embd * text_weights[..., None]
          )  # (bs, nmods, d_model)
      else:
          embd_wg = text_embd
  
      bs = embd_wg.size(0)
      text_embd = embd_wg.view(bs, -1)
  
      return text_embd
  
imports: import os
  import torch
  import torch.nn.functional
  from typing import Any, List, Dict
  from collections import OrderedDict
  from torch import nn
  from towhee.models.mdmmt.bert_mmt import BertMMT
label_desc: Use image node_id 4 for calling the MMTTXT obj's underlying member method code with example usage: obj.forward(text_list) and returns: text_embd