class_docstr: Build triton models from towhee pipeline.
class_docstr_tok: ["Build","triton","models","from","towhee","pipeline","."]
docstr: load operator
docstr_tok: ["load","operator"]
code: def _load_op(
      op_name: str, init_args: tuple, init_kws: Dict
  ) -> "Operator":
      """
      load operator
      """
      name = op_name.split("/")
      if len(name) == 2:
          hub_id, name = name[0], name[1]
      else:
          hub_id, name = "towhee", name[0]
      try:
          hub = getattr(ops, hub_id)
          init_args = () if init_args is None else init_args
          init_kws = {} if init_kws is None else init_kws
          return getattr(hub, name)(*init_args, **init_kws).get_op()
      except Exception as e:  # pylint: disable=broad-except
          engine_log.error(
              "Load operator: %s by init args: [%s] and kws: [%s] failed, error: %s",
              op_name,
              init_args,
              init_kws,
              e,
          )
          return None
  
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 2 for calling the Builder obj's underlying member method code with example usage: obj._load_op(op_name, init_args, init_kws) and returns: getattr, None