code: def try_to_load_from_cache(
      model_id: str, revision: Optional[str], filename: str
  ) -> Optional[Path]:
      """Try to load a file from the Hugging Face cache"""
  
      d = _get_cached_revision_directory(model_id, revision)
      if not d:
          return None
  
      # Check if file exists in cache
      cached_file = d / filename
      return cached_file if cached_file.is_file() else None
  
file_path: text-generation-inference/server/text_generation_server/utils/hub.py
imports: import time
  import os
  from datetime import timedelta
  from loguru import logger
  from pathlib import Path
  from typing import Optional, List
  from huggingface_hub import file_download, hf_api, HfApi, hf_hub_download
  from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE
  from huggingface_hub.utils import LocalEntryNotFoundError, EntryNotFoundError, RevisionNotFoundError
label_desc: Use image node_id 6 for calling a global function with example usage: try_to_load_from_cache(model_id, revision, filename) and returns: unknown, None