code: def cli_collect_weights(sys_argv):
      """Command Line Interface to collecting the weights for the model.
  
      --m: Input model that is necessary to collect to the tensors, this is a
           required *option*
      --t: Tensors to collect
      --od: Output directory of the model, defaults to results
      --v: Verbose: Defines the logging level that the user will be exposed to
      """
      parser = argparse.ArgumentParser(
          description="This script loads a pretrained model "
          "and uses it collect weights.",
          prog="ludwig collect_weights",
          usage="%(prog)s [options]",
      )
  
      # ----------------
      # Model parameters
      # ----------------
      parser.add_argument(
          "-m", "--model_path", help="model to load", required=True
      )
      parser.add_argument(
          "-t",
          "--tensors",
          help="tensors to collect",
          nargs="+",
          required=True,
      )
  
      # -------------------------
      # Output results parameters
      # -------------------------
      parser.add_argument(
          "-od",
          "--output_directory",
          type=str,
          default="results",
          help="directory that contains the results",
      )
  
      # ------------------
      # Runtime parameters
      # ------------------
      parser.add_argument(
          "-l",
          "--logging_level",
          default="info",
          help="the level of logging to use",
          choices=[
              "critical",
              "error",
              "warning",
              "info",
              "debug",
              "notset",
          ],
      )
  
      add_contrib_callback_args(parser)
      args = parser.parse_args(sys_argv)
  
      args.callbacks = args.callbacks or []
      for callback in args.callbacks:
          callback.on_cmdline("collect_weights", *sys_argv)
  
      args.logging_level = get_logging_level_registry()[
          args.logging_level
      ]
      logging.getLogger("ludwig").setLevel(args.logging_level)
      global logger
      logger = logging.getLogger("ludwig.collect")
  
      print_ludwig("Collect Weights", LUDWIG_VERSION)
  
      collect_weights(**vars(args))
  
imports: import argparse
  import logging
  import os
  import sys
  from typing import List, Optional, Union
  import numpy
  import torch
  import torchinfo
  from ludwig.api import LudwigModel
  from ludwig.backend import ALL_BACKENDS, Backend
  from ludwig.callbacks import Callback
  from ludwig.constants import FULL, TEST, TRAINING, VALIDATION
  from ludwig.contrib import add_contrib_callback_args
  from ludwig.globals import LUDWIG_VERSION
  from ludwig.utils.print_utils import get_logging_level_registry, print_boxed, print_ludwig
  from ludwig.utils.strings_utils import make_safe_filename
label_desc: Use image node_id 6 for calling a global function with example usage: cli_collect_weights(sys_argv) without return types