code: def _hf_model_list() -> List[ModelInfo]:
      cache_file_path = os.path.join(
          mii_cache_path(), "MII_model_cache.pkl"
      )
      cache_expiration_seconds = os.getenv(
          MII_HF_CACHE_EXPIRATION, MII_HF_CACHE_EXPIRATION_DEFAULT
      )
  
      # Load or initialize the cache
      model_data = {"cache_time": 0, "model_list": []}
      if os.path.isfile(cache_file_path):
          with open(cache_file_path, "rb") as f:
              model_data = pickle.load(f)
  
      current_time = time.time()
  
      # Update the cache if it has expired
      if (
          model_data["cache_time"] + cache_expiration_seconds
      ) < current_time:
          api = HfApi()
          model_data["model_list"] = [
              ModelInfo(
                  modelId=m.modelId,
                  pipeline_tag=m.pipeline_tag,
                  tags=m.tags,
              )
              for m in api.list_models()
          ]
          model_data["cache_time"] = current_time
  
          # Save the updated cache
          with open(cache_file_path, "wb") as f:
              pickle.dump(model_data, f)
  
      return model_data["model_list"]
  
imports: import importlib
  import pickle
  import os
  import time
  import deepspeed
  from dataclasses import dataclass
  from typing import List, TYPE_CHECKING
  from datetime import timedelta
  from huggingface_hub import HfApi
  from transformers import AutoConfig
  import mii
  from mii.constants import MII_CACHE_PATH, MII_CACHE_PATH_DEFAULT, REQUIRED_KEYS_PER_TASK, MII_HF_CACHE_EXPIRATION, MII_HF_CACHE_EXPIRATION_DEFAULT
  from mii.logging import logger
  from mii.score.generate import generated_score_path
label_desc: Use image node_id 1 for calling a global function with example usage: _hf_model_list() and returns: model_data