code: def __init__(
      self,
      name: str,
      model_repository: str,
      tritonserver_type: _TritonServerType = "grpc",
      cli_args: list[str] | None = None,
  ):
      if cli_args is None:
          cli_args = []
  
      cli_args.append(f"--model-repository={model_repository}")
  
      if tritonserver_type == "http":
          cli_args.extend(
              [
                  "--allow-grpc=False",
                  "--http-address=127.0.0.1",
              ]
          )
      elif tritonserver_type == "grpc":
          cli_args.extend(
              [
                  "--reuse-grpc-port=1",
                  "--allow-http=False",
                  "--grpc-address=0.0.0.0",
              ]
          )
  
      # default settings, disable metrics
      cli_args.extend(
          [f"--log-verbose={1 if _get_debug_mode() else 0}"]
      )
  
      if not all(s.startswith("--") for s in cli_args):
          raise ValueError(
              "cli_args should be a list of strings starting with '--' for TritonRunner."
          )
  
      self.__attrs_init__(
          name=name,
          models=None,
          resource_config=None,
          runnable_class=self.__class__,
          repository_path=model_repository,
          tritonserver_type=tritonserver_type,
          cli_args=cli_args,
          embedded=False,  # NOTE: TritonRunner shouldn't be used as embedded.
      )
  
imports: from __future__ import annotations
  import logging
  import typing
  from functools import cached_property
  import attr
  from simple_di import Provide
  from simple_di import inject
  from ._internal.configuration import get_debug_mode
  from ._internal.configuration.containers import BentoMLContainer
  from ._internal.runner.runnable import RunnableMethodConfig
  from ._internal.runner.runner import AbstractRunner
  from ._internal.runner.runner import RunnerMethod
  from ._internal.runner.runner import object_setattr
  from ._internal.runner.runner_handle import DummyRunnerHandle
  from ._internal.runner.runner_handle.remote import TRITON_EXC_MSG
  from ._internal.runner.runner_handle.remote import handle_triton_exception
  from ._internal.utils import LazyLoader
  from .exceptions import StateException
label_desc: Use image node_id 1 to create a new _TritonRunner object from inherited base classes: _AbstractRunner with example: obj = _TritonRunner(name, model_repository, tritonserver_type, cli_args)