
Understand how Hugging Face applies transformer architectures to large language models and text generation. Explore base LM training, instruction tuning, and reinforcement learning from human feedback for alignment.
Learn to manage compute for large language models by balancing 32-bit precision, memory demands, and small batch sizes during training.
Hugging Face enables you to work with large language models and transformers through built-in functions, pip install transformers, datasets, and a streamlined path to models in Python.
Access pre-trained models from Hugging Face using the transformers library and pipeline. Load GPT-2 tokenizer and model, then generate text and explore tokenizers, datasets, and generation parameters.
Learn how tokenizers from Hugging Face convert text to token IDs and attention masks, handle padding and truncation, and prepare input for models like Distilbert sentiment analysis.
Explore how the transformers pipeline streamlines tokenizers and generation, automatically selects models for tasks like sentiment analysis and text generation; access embeddings, configs, and save or share trained models.
Load and preprocess Hugging Face datasets with load_dataset, shuffle and split into train, validation, and test, then create and push a custom Reuters dataset to your Hugging Face hub.
train a GPT-2 tokenizer on a Reuters dataset by concatenating title and body into articles, fine-tune 52k vocabulary, and push to the hub to train a GPT-2 model from scratch.
Fine tune pre-trained models on domain-specific data using full and parameter-efficient methods. Learn Laura via the Pfft library in Transformers to update a small weight subset while preserving most knowledge.
Learn to perform full fine-tuning of Bart for dialogues summarization using Hugging Face datasets, the Transformers library, and push the fine-tuned model to the hub.
Demonstrate parameter efficient fine tuning with LoRA on a Bart summarization model, achieving faster training and a 33% time reduction by updating only the left adapter.
Train a GPT-2 model from scratch on a Reuters dataset with a custom tokenizer and full articles, using a 512 context and 52k vocabulary, then push to Hugging Face hub.
Explore quantization to shrink memory for hugging face models, enabling loading and training of billion-parameter models by lowering precision from fp32 to bf16, fp16, int8, and int4.
Discover how to reduce numeric precision with torch, compare fp64, fp32, fp16, bf16, and int8, and observe how lower precision cuts memory needs for tensor storage.
Quantize a 7B Hugging Face Falcon model from fp32 to eight and four-bit precision using bits and bytes, nf4, and double quantization to reduce memory footprint.
Explore multimodal large language models that process text, images, and video to generate captions, descriptions, or answers, including image captioning and image-based questions about apples and SEC data.
Load an 8.4 billion parameter image captioning model from hugging face with four-bit quantization on GPU, process images, use few-shot prompting, and generate captions including a cat on a table.
Load a fine-tuned document question answering model with an OCR engine to extract text and answer questions about Apple's income statement, balance sheet, and cash flow from SEC filings.
Discover the latest AI research weekly with Behind the Hood, a free newsletter that scrapes arXiv for impactful papers on multimodal llms, embodied agents, robotics, and quantization.
Welcome to "Learn Hugging Face for Mastering Generative AI with LLMs". In today's AI-driven world, Hugging Face has become a central platform for working with Large Language Models (LLMs), which have revolutionized generative AI by enabling machines to generate human-like text, answer questions, and even create original content. This course is meticulously designed to give you a deep understanding of these models and how to harness their power using Hugging Face.
Our journey begins with a robust introduction to LLMs, exploring their intricacies and how to manage their compute requirements, all within the Hugging Face ecosystem. From there, we dive into the world of Hugging Face, which provides an extensive collection of pre-trained models that can be applied in a wide range of innovative applications.
Practical knowledge is essential, so the course transitions into a deep dive into Transformers, a key technology behind LLMs, with a special focus on Hugging Face implementations. You'll get hands-on experience with Hugging Face tools, manipulating datasets, building custom models, and mastering tokenization.
Finally, we emphasize training, fine-tuning, and quantization, with models downloaded from Hugging Face. Learn how to adjust LLMs to your needs, whether for summarization or text generation. With techniques like Instruction Fine-tuning and PEFT, you'll master the art of fine-tuning models. We’ll even show you how to train a GPT-2 from scratch using Hugging Face to generate text from a custom dataset. Then finally, we will show you how to quantize your models so that they take up less memory.