class_docstr: Build triton models from towhee pipeline.
class_docstr_tok: ["Build","triton","models","from","towhee","pipeline","."]
code: def _model_convert(self, node_repr: "NodeRepr"):
      op_name = node_repr.op_info.operator
      op_init_args = node_repr.op_info.init_args
      op_init_kws = node_repr.op_info.init_kws
      op = self._load_op(op_name, op_init_args, op_init_kws)
      if op is None:
          return False
  
      if isinstance(op, NNOperator):
          if not hasattr(op, "supported_formats"):
              return True
          model_name = node_repr.name.replace("/", ".")
          converter = ModelToTriton(
              self._model_root,
              op,
              model_name,
              node_repr.config,
              self._server_conf,
          )
          status = converter.to_triton()
          if status == -1:
              return False
          elif status == 0:
              return True
          inputs, outputs = converter.get_model_in_out()
          acc_conf = {
              "model_name": model_name,
              "inputs": inputs,
              "outputs": outputs,
          }
          node_repr.config.acc_info = AcceleratorConf(
              type="triton", params=acc_conf
          )
      return True
  
file_path: towhee/towhee/serve/triton/pipeline_builder.py
imports: from typing import Dict
  from tqdm import tqdm
  from towhee.utils.log import engine_log
  from towhee.runtime import ops, AcceleratorConf
  from towhee.operator import NNOperator
  from towhee.serve.triton import constant
  from towhee.serve.triton.model_to_triton import ModelToTriton
  from towhee.serve.triton.pipe_to_triton import PipeToTriton
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._model_convert(node_repr) and returns: True, False, True, False, True