class_docstr: A worker class that executes (a partition of) the model on a GPU.
  
  Each worker is associated with a single GPU. The worker is responsible for
  maintaining the KV cache and executing the model on the GPU. In case of
  distributed inference, each worker is assigned a partition of the model.
code: def init_model(self):
      if self.model_config.device == "gpu":
          # This env var set by Ray causes exceptions with graph building.
          os.environ.pop("NCCL_ASYNC_ERROR_HANDLING", None)
          # Env vars will be set by Ray.
          self.rank = (
              self.rank
              if self.rank is not None
              else int(os.getenv("RANK", "-1"))
          )
          local_rank = int(os.getenv("LOCAL_RANK", "0"))
          self.device = torch.device(f"cuda:{local_rank}")
          if self.rank < 0:
              invalidInputError(False, "Invalid or unspecified rank.")
          torch.cuda.set_device(self.device)
  
          _check_if_gpu_supports_dtype(self.model_config.dtype)
  
          # Initialize the distributed environment.
          # Co(gc): Consider this later
          # _init_distributed_environment(self.parallel_config, self.rank,
          #                               self.distributed_init_method)
  
      # Initialize the model.
      set_random_seed(self.model_config.seed)
      self.model = get_model(self.model_config)
  
imports: import os
  from typing import Dict, List, Tuple, Optional
  import torch
  import torch.distributed
  import warnings
  import numpy
  import random
  from bigdl.llm.vllm.config import ModelConfig, SchedulerConfig
  from bigdl.llm.vllm.model_executor.model_loader import get_model
  from bigdl.llm.vllm.model_executor.input_metadata import InputMetadata
  from bigdl.llm.vllm.sampling_params import SamplingParams
  from bigdl.llm.vllm.sequence import SequenceData, SamplerOutput, SequenceGroupMetadata
  from bigdl.llm.utils.common import invalidInputError
  from bigdl.llm.vllm.model_executor.utils import set_random_seed
label_desc: Use image node_id 3 for calling the Worker obj's underlying member method code with example usage: obj.init_model() without return types