From the course: Hands-On AI: Building Your First Conversational AI Chatbot
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Fine-tuning with Trainer API
From the course: Hands-On AI: Building Your First Conversational AI Chatbot
Fine-tuning with Trainer API
- [Instructor] In this video, we're going to fine tune our chatbot model using Hugging Faces Trainer API. It's a high-level training interface that simplifies the process of fine tuning transformer models. We'll start by defining our training configuration using the training arguments class. This is where we control how training behaves behind the scenes. Let's break this down. Output directory tells where the fine-tuned model files will be saved. Learning rate defines how quickly the model updates its parameters during training. A small value like 5e minus 5 is usually a good choice when fine tuning pre-trained models. Next, we set per device trained batch size and per device eval batch size to two. This determines how many training examples are processed together in each batch. Since chatbot dialogues can be long and memory intensive, small batch sizes help us avoid out of memory issues. We then set num train epochs equals three. This means the model will go through the training…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.