Machine Learning

Customizing Your Programming Code Using HuggingFace's Transformers Library | by Maeda Hanafi, PhD | January, 2025

Examples of custom callbacks and custom tuning code from various libraries

About Data Science
Image created by Gemini

The HuggingFace transformer library provides many basic building blocks and a variety of functions to run your AI code. Many products and libraries have been built on top of it and in this short blog, I'll talk about some of the ways people have extended it to add custom training code on top of the HuggingFace transformer library:

  1. Reuse the training code by iterating through the training data to recreate the fine-tuning loop and adding in custom code, too
  2. Creates custom callbacks included in the Coach class so that custom code can be added to the callbacks.

Obviously, there may be other ways to customize the tuning loop, but this blog is intended to focus on these two methods.

Usually when training a model, a Coach An object is created that allows you to specify parameters for training the model. The trainer's object appears a train() method you can call that starts the training loop:

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button