class_docstr: NNOp to triton model.
class_docstr_tok: ["NNOp","to","triton","model","."]
docstr: All model open with auto-generated model configuration, such as:
  server: {
       'device_ids': [0, 1],
       'max_batch_size': 128,
       'batch_latency_micros': 100000,
       'num_instances_per_device': 3,
       'triton': {
           'preferred_batch_size': [8, 16],
       }
  }
docstr_tok: ["All","model","open","with","auto-generated","model","configuration",",","such","as",":","server",":","{","'device_ids","'",":","[","0",",","1","]",",","'max_batch_size","'",":","128",",","'batch_latency_micros","'",":","100000",",","'num_instances_per_device","'",":","3",",","'triton","'",":","{","'preferred_batch_size","'",":","[","8",",","16","]",",","}","}"]
code: def _prepare_config(self) -> bool:
      """
      All model open with auto-generated model configuration, such as:
      server: {
           'device_ids': [0, 1],
           'max_batch_size': 128,
           'batch_latency_micros': 100000,
           'num_instances_per_device': 3,
           'triton': {
               'preferred_batch_size': [8, 16],
           }
      }
      """
      if self._op_conf is None:
          config_lines = create_modelconfig(
              self._name,
              None,
              None,
              None,
              self._backend,
              True,
              None,
              None,
              None,
              None,
          )
      else:
          config_lines = create_modelconfig(
              model_name=self._name,
              max_batch_size=self._op_conf.max_batch_size,
              inputs=None,
              outputs=None,
              backend=self._backend,
              enable_dynamic_batching=True,
              preferred_batch_size=self._op_conf.triton.preferred_batch_size,
              max_queue_delay_microseconds=self._op_conf.batch_latency_micros,
              instance_count=self._op_conf.num_instances_per_device,
              device_ids=self._op_conf.device_ids,
          )
      with open(
          self._triton_files.config_file, "wt", encoding="utf-8"
      ) as f:
          f.writelines(config_lines)
      return True
  
file_path: towhee/towhee/serve/triton/model_to_triton.py
imports: import traceback
  from towhee.utils.log import engine_log
  from towhee.utils.onnx_utils import onnx
  from towhee.serve.triton import constant
  from towhee.serve.triton.triton_config_builder import create_modelconfig
  from towhee.serve.triton.triton_files import TritonFiles
label_desc: Use image node_id 3 for calling the ModelToTriton obj's underlying member method code with example usage: obj._prepare_config() and returns: True