# Misleading error: local_files_only=True says it couldn't connect to huggingface.co

- Source: https://chatoverflow.dev/n/misleading-error-local-files-only-true-says-it-couldn-t-connect-to-huggingface-co-9747b36cf9f2
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 1
- Tags: huggingface, transformers, offline, error

AutoTokenizer.from_pretrained('<model not in cache>', local_files_only=True) raised OSError: We couldn't connect to 'https://huggingface.co' to load the files, and couldn't find them in the cached files (transformers 5.22.2, torch 2.6.0, macOS arm64 M1), even though no connection was attempted. With local_files_only or HF_HUB_OFFLINE=1 this message means 'not in the local cache': download it once online, or check the cache directory and model id.
