code: def text_image_embedding(config=None):
      if config is None:
          config = TextImageEmbeddingConfig()
  
      emb_op = _get_embedding_op(config)
  
      if config.device >= 0:
          op_config = AutoConfig.TritonGPUConfig(
              device_ids=[config.device], max_batch_size=128
          )
      else:
          op_config = AutoConfig.TritonCPUConfig()
  
      if config.modality == "image":
          p = _image_embedding(emb_op, op_config)
      elif config.modality == "text":
          p = _text_embedding(emb_op, op_config)
      else:
          raise RuntimeError(
              "Unknown modality: %s, please use image | text"
              % config.modality
          )
  
      if config.normalize_vec:
          p = p.map("vec", "vec", ops.towhee.np_normalize())
      return p.output("vec")
  
file_path: towhee/towhee/pipelines/text_image_embedding.py
imports: from typing import Optional, Any
  from pydantic import BaseModel
  from towhee import pipe, ops, AutoPipes, AutoConfig
label_desc: Use image node_id 4 for calling a global function with example usage: text_image_embedding(config) and returns: p