src/transformers/models/rag/retrieval_rag.py/LegacyIndex/_resolve_path
class LegacyIndex:    def _resolve_path(self, index_path, filename):
        is_local = os.path.isdir(index_path)
        try:
            # Load from URL or cache if already cached
            resolved_archive_file = cached_file(index_path, filename)
        except EnvironmentError:
            msg = (
                f"Can't load '{filename}'. Make sure that:\n\n"
                f"- '{index_path}' is a correct remote path to a directory containing a file named {filename}\n\n"
                f"- or '{index_path}' is the correct path to a directory containing a file named {filename}.\n\n"
            )
            raise EnvironmentError(msg)
        if is_local:
            logger.info(f"loading file {resolved_archive_file}")
        else:
            logger.info(f"loading file {filename} from cache at {resolved_archive_file}")
        return resolved_archive_file