Python guides
Every published Python guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Python guides
Most readLatest Python guides
Page 33 of 179Python Transformers GPU and Batch Inference
python transformers gpu and batch inference: Learn how to run Hugging Face Transformers models on GPU with batched inputs to improve throughput and reduce inference la...
Save and Load Local Models with Python Transformers
Use save_pretrained and from_pretrained in Python to save and reload fine-tuned Hugging Face models from a local directory, including what gets written and common failure modes.
Python Transformers Embeddings and Feature Extraction
python transformers embeddings and feature extraction: Learn how to extract embeddings and feature vectors from text using Python Transformers, covering tokenization,...
Python Transformers for Summarization, Translation, and QA
python transformers summarization translation and question answering: Learn to use Python Transformers for summarization, translation, and question answering with prac...
Python Transformers: Padding, Truncation, and Attention Masks
Understand how Hugging Face tokenizers use padding, truncation, and attention masks to shape batches for transformer models, with practical examples and common edge cases.
Using AutoTokenizer and AutoModel in Hugging Face Transformers
Learn how AutoTokenizer and AutoModel simplify loading pretrained models and tokenizers in the Hugging Face transformers library, including task-specific variants and tokenizer behavior.
Python Transformers Pipeline for Sentiment and Generation
python transformers pipeline text classification sentiment and generation: Use the Transformers pipeline API for sentiment analysis and text generation in Python: mode...
PyTorch vs TensorFlow: Which One Fits Your Project
Compare PyTorch and TensorFlow from a developer's perspective: API design, training loops, debugging, deployment, and decision criteria for your project.
Python PyTorch GPU Memory Optimization
python pytorch gpu memory optimization: Learn practical techniques to reduce GPU memory usage in PyTorch: mixed precision, gradient accumulation, checkpointing, and pr...
PyTorch Mixed Precision Training with torch.cuda.amp
Use PyTorch's autocast and GradScaler for mixed precision training on CUDA GPUs: reduce memory use, accelerate Tensor Core GPUs, and avoid gradient underflow.