code: def sentence_embedding(config=None):
      """
      Define pipeline
      """
      if config is None:
          config = SentenceSimilarityConfig()
  
      allow_triton, emb_op = _get_embedding_op(config)
      op_config = {}
      if allow_triton:
          if config.device >= 0:
              op_config = AutoConfig.TritonGPUConfig(
                  device_ids=[config.device], max_batch_size=128
              )
          else:
              op_config = AutoConfig.TritonCPUConfig()
      p = pipe.input("text").map(
          "text", "vec", emb_op, config=op_config
      )
  
      if config.normalize_vec:
          p = p.map("vec", "vec", ops.towhee.np_normalize())
      return p.output("vec")
  
imports: from typing import Optional, Any
  from pydantic import BaseModel
  from towhee import ops, pipe, AutoPipes, AutoConfig
label_desc: Use image node_id 2 for calling a global function with example usage: sentence_embedding(config) and returns: p