code: def load_experts(
      experts: Dict[str, ModuleBackend], checkpoint_dir: Path
  ):
      assert is_directory(checkpoint_dir)
      for expert_name, expert in experts.items():
          checkpoints_folder = checkpoint_dir / expert_name
          latest_checkpoint = checkpoints_folder / "checkpoint_last.pt"
          if latest_checkpoint.exists():
              expert.load_state_dict(torch.load(latest_checkpoint))
          else:
              logger.warning(
                  f"Failed to load checkpoint for expert {expert_name}"
              )
  
file_path: hivemind/hivemind/moe/server/checkpoints.py
imports: import os
  import threading
  from datetime import datetime
  from pathlib import Path
  from shutil import copy2
  from tempfile import TemporaryDirectory
  from typing import Dict
  import torch
  from hivemind.moe.server.module_backend import ModuleBackend
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 4 for calling a global function with example usage: load_experts(experts, checkpoint_dir) without return types