Skip to main content

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​

  1. Re-run the install smoke test from Installation
  2. Confirm GPU visibility: nvidia-smi and torch.cuda.is_available()
  3. Delete corrupted cache entries under ~/.cache/huggingface/hub for a specific repo if downloads break
  4. Pin revision if a Hub update changed behaviour
  5. Ensure tokenizer/pad_token is set for GPT-style generate calls

Common failure modes​

SymptomLikely cause
CUDA OOMBatch/sequence too large; try dtype, PEFT, quantisation
trust_remote_code errorsCustom model requires review + flag
Gated repo 401/403Missing login / licence acceptance
Nonsense generationsWrong chat template or mixing tokenizers
Slow first callDownload + compile + CUDA warmup

Official page: Troubleshooting.

Discussion

Comments​

Share feedback or questions about this page. No account required.

Loading comments…