class_docstr: Provides methods that implement functionality of route guide server.
class_docstr_tok: ["Provides","methods","that","implement","functionality","of","route","guide","server","."]
code: def __init__(
      self,
      model_dir,
      punctuation_model_path,
      beam_size=1,
      len_pen=0.6,
      max_delta_length=5,
      batch_size=256,
  ):
      self._models = {}
      self._beam_size = beam_size
      self._len_pen = len_pen
      self._max_delta_length = max_delta_length
      self._batch_size = batch_size
      self._punctuation_model_path = punctuation_model_path
      self._model_dir = model_dir
  
      model_paths = [
          os.path.join(model_dir, fname)
          for fname in os.listdir(model_dir)
          if fname.endswith(".nemo")
      ]
  
      for idx, model_path in enumerate(model_paths):
          assert os.path.exists(model_path)
          logging.info(f"Loading model {model_path}")
          self._load_model(model_path)
  
      if self._punctuation_model_path != "":
          assert os.path.exists(punctuation_model_path)
          logging.info(f"Loading punctuation model {model_path}")
          self._load_puncutation_model(punctuation_model_path)
  
      logging.info("Models loaded. Ready for inference requests.")
  
file_path: NeMo/tools/nmt_grpc_service/server.py
imports: import argparse
  import os
  from concurrent import futures
  import api.nmt_pb2
  import api.nmt_pb2_grpc
  import grpc
  import torch
  import nemo.collections.nlp
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new RivaTranslateServicer object from inherited base classes: nmtsrv with example: obj = RivaTranslateServicer(model_dir, punctuation_model_path, beam_size, len_pen, max_delta_length, batch_size)