code: def _cached_weight_files(
      model_id: str, revision: Optional[str], extension: str
  ) -> List[str]:
      """Guess weight files from the cached revision snapshot directory"""
      d = _get_cached_revision_directory(model_id, revision)
      if not d:
          return []
      filenames = _weight_files_from_dir(d, extension)
      return filenames
  
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 1 for calling a global function with example usage: _cached_weight_files(model_id, revision, extension) and returns: filenames, list