code: def update_model(
      background_tasks: BackgroundTasks, model: str, file: UploadFile
  ):
      ext = (
          "".join(pathlib.Path(file.filename).suffixes)
          if file.filename
          else ".pt"
      )
      model_file = tempfile.NamedTemporaryFile(suffix=ext).name
  
      with open(model_file, "wb") as buffer:
          shutil.copyfileobj(file.file, buffer)
          background_tasks.add_task(remove_file, model_file)
  
      instance: MONAILabelApp = app_instance()
      prev_file = instance.model_file(model, validate=False)
      if not prev_file:
          raise HTTPException(
              status_code=500,
              detail=f"Model File Name NOT configured for {model}",
          )
  
      if not os.path.exists(prev_file):
          logger.info(
              f"Previous Model File [{prev_file}] NOT Found for {model}; Adding new one!"
          )
  
      logger.info(
          f"Updating Model File for model: {model}; {model_file} => {prev_file}"
      )
      shutil.copy(model_file, prev_file)
  
      s = os.stat(prev_file)
      checksum = file_checksum(prev_file)
      return {"checksum": checksum, "modified_time": int(s.st_mtime)}
  
file_path: MONAILabel/monailabel/endpoints/model.py
imports: import logging
  import os
  import pathlib
  import shutil
  import tempfile
  from datetime import datetime
  from fastapi import APIRouter, Depends, HTTPException, UploadFile
  from fastapi.background import BackgroundTasks
  from fastapi.responses import FileResponse
  from monailabel.config import RBAC_ADMIN, settings
  from monailabel.endpoints.user.auth import RBAC, User
  from monailabel.interfaces.app import MONAILabelApp
  from monailabel.interfaces.utils.app import app_instance
  from monailabel.utils.others.generic import file_checksum, file_ext, get_mime_type, remove_file
label_desc: Use image node_id 3 for calling a global function with example usage: update_model(background_tasks, model, file) and returns: dict