code: def __init__(
      self,
      controller_addr,
      worker_addr,
      worker_id,
      no_register,
      model_path,
      model_base,
      model_name,
      load_8bit,
      load_4bit,
      keep_aspect_ratio,
      num_gpus,
      add_region_feature,
      image_w,
      image_h,
  ):
      self.image_w = image_w
      self.image_h = image_h
      self.controller_addr = controller_addr
      self.worker_addr = worker_addr
      self.worker_id = worker_id
      if model_path.endswith("/"):
          model_path = model_path[:-1]
      if model_name is None:
          model_paths = model_path.split("/")
          if model_paths[-1].startswith("checkpoint-"):
              self.model_name = model_paths[-2] + "_" + model_paths[-1]
          else:
              self.model_name = model_paths[-1]
      else:
          self.model_name = model_name
  
      logger.info(
          f"Loading the model {self.model_name} on worker {worker_id} ..."
      )
      self.keep_aspect_ratio = keep_aspect_ratio
      self.add_region_feature = add_region_feature
      (
          self.tokenizer,
          self.model,
          self.image_processor,
          self.context_len,
      ) = load_pretrained_model(
          model_path, model_base, self.model_name, load_8bit, load_4bit
      )
      self.is_multimodal = (
          "llava" in self.model_name.lower()
          or "ferret" in self.model_name.lower()
      )
  
      if not no_register:
          self.register_to_controller()
          self.heart_beat_thread = threading.Thread(
              target=heart_beat_worker, args=(self,)
          )
          self.heart_beat_thread.start()
  
imports: import argparse
  import asyncio
  import json
  import time
  import threading
  import uuid
  from fastapi import FastAPI, Request, BackgroundTasks
  from fastapi.responses import StreamingResponse
  import requests
  import torch
  import uvicorn
  from functools import partial
  from ferret.constants import WORKER_HEART_BEAT_INTERVAL
  from ferret.utils import build_logger, server_error_msg, pretty_print_semaphore
  from ferret.model.builder import load_pretrained_model
  from ferret.mm_utils import process_images, load_image_from_base64, tokenizer_image_token, KeywordsStoppingCriteria
  from ferret.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
  from threading import Thread
label_desc: Use image node_id 1 to create a new ModelWorker object  with example: obj = ModelWorker(controller_addr, worker_addr, worker_id, no_register, model_path, model_base, model_name, load_8bit, load_4bit, keep_aspect_ratio, num_gpus, add_region_feature, image_w, image_h)