Troubleshooting
Adapted for this playbook from the 🤗 Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/troubleshooting. Images © Hugging Face (
documentation-images) unless noted. This is not a substitute for the upstream docs — verify against the current version.Covers Hugging Face pages: troubleshooting
Fast checks​
- Re-run the install smoke test from Installation
- Confirm GPU visibility:
nvidia-smiandtorch.cuda.is_available() - Delete corrupted cache entries under
~/.cache/huggingface/hubfor a specific repo if downloads break - Pin
revisionif a Hub update changed behaviour - Ensure tokenizer/
pad_tokenis set for GPT-style generate calls
Common failure modes​
| Symptom | Likely cause |
|---|---|
| CUDA OOM | Batch/sequence too large; try dtype, PEFT, quantisation |
trust_remote_code errors | Custom model requires review + flag |
| Gated repo 401/403 | Missing login / licence acceptance |
| Nonsense generations | Wrong chat template or mixing tokenizers |
| Slow first call | Download + compile + CUDA warmup |
Official page: Troubleshooting.
Discussion
Comments​
Share feedback or questions about this page. No account required.
Loading comments…