code: def start_sentence_bert_server(
      name: str,
      devices: str,
      tokenizer: TokenizerSpec,
      sentence_bert: str = "all-mpnet-base-v2",
      sentence_bert_batch: int = 4,
      port: int = None,
  ):
      """
      Start the sentence bert server method.
      It only starts the server at rank 0 worker.
      Doesn't support multiple nodes yet.
      """
      # register the bert model port number
      server = SentenceBertServer(
          name,
          devices,
          tokenizer,
          sentence_bert,
          sentence_bert_batch,
      )
      server.run("0.0.0.0", port=port)
      # sleep to make sure the sentence bert server is full started.
      time.sleep(2)
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/retrieval_services/bert_service.py
imports: import base64
  import pickle
  import threading
  import time
  from typing import List, Union
  import torch
  from flask import Flask, jsonify, request
  from flask_restful import Api, Resource
  from sentence_transformers import SentenceTransformer
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
label_desc: Use image node_id 1 for calling a global function with example usage: start_sentence_bert_server(name, devices, tokenizer, sentence_bert, sentence_bert_batch, port) without return types