code: def convert_model_checkpoints(
      model_dirname: str, keep_deepspeed: bool = False
  ):
      model_config_fname = os.path.join(model_dirname, C.CONFIG_NAME)
      # Find and convert params.00000, etc.
      for fname in os.listdir(model_dirname):
          if (
              fname.startswith(C.PARAMS_PREFIX)
              and fname[len(C.PARAMS_PREFIX) :].isdigit()
          ):
              params_fname = os.path.join(model_dirname, fname)
              if os.path.isdir(params_fname):
                  logger.info(f"Converting checkpoint {params_fname}")
                  # Move directory checkpoint to e.g., params.00000.ds
                  checkpoint_dirname = params_fname + ".ds"
                  shutil.move(params_fname, checkpoint_dirname)
                  # Create params file for directory checkpoint
                  convert_checkpoint_to_params(
                      model_config_fname,
                      checkpoint_dirname,
                      params_fname,
                  )
                  if not keep_deepspeed:
                      shutil.rmtree(checkpoint_dirname)
      # Update params.best
      params_best_fname = os.path.join(
          model_dirname, C.PARAMS_BEST_NAME
      )
      if os.path.exists(params_best_fname) and os.path.islink(
          params_best_fname
      ):
          logger.info(f"Updating {params_best_fname}")
          params_best_target = os.readlink(params_best_fname)
          os.remove(params_best_fname)
          os.symlink(params_best_target, params_best_fname)
  
file_path: sockeye/sockeye/convert_deepspeed.py
imports: import argparse
  import collections
  import gc
  import logging
  import os
  import shutil
  import torch
  from .None import constants
  from .None import log
  from .None import model
  from .None import utils
label_desc: Use image node_id 3 for calling a global function with example usage: convert_model_checkpoints(model_dirname, keep_deepspeed) without return types