SyncAI.news, a Varaisys broadcasting
CO2 Emissions and the 馃 Hub: Leading the Charge
HF

Hugging Face Blog

路 1 min read

AI LabsHugging Face Blog

CO2 Emissions and the 馃 Hub: Leading the Charge

What are CO2 Emissions and why are they important?

Climate change is one of the greatest challenges that we are facing and reducing emissions of greenhouse gases such as carbon dioxide (CO2) is an important part of tackling this problem.

Training and deploying machine learning models will emit CO2 due to the energy usage of the computing infrastructures that are used: from GPUs to storage, it all needs energy to function and emits CO2 in the process.

Pictured: Recent Transformer models and their carbon footprints

The amount of CO2 emitted depends on different factors such as runtime, hardware used, and carbon intensity of the energy source.

Using the tools described below will help you both track and report your own emissions (which is important to improve the transparency of our field as a whole!) and choose models based on their carbon footprint.

How to calculate your own CO2 Emissions automatically with Transformers

Before we begin, if you do not have the latest version of the huggingface_hub library on your system, please run the following:

pip install huggingface_hub -U

How to find low-emission models using the Hugging Face Hub

With the model now uploaded to the Hub, how can you search for models on the Hub while trying to be eco-friendly? Well, the huggingface_hub library has a new special parameter to perform this search: emissions_threshold. All you need to do is specify a minimum or maximum number of grams, and all models that fall within that range.

For example, we can search for all models that took a maximum of 100 grams to make:

from huggingface_hub import HfApi

api = HfApi()
models = api.list_models(emissions_thresholds=(None, 100), cardData=True)
len(models)
>>> 191

There were quite a few! This also helps to find smaller models, given they typically did not release as much carbon during training.

We can look at one up close to see it does fit our threshold:

models = api.list_models(emissions_thresholds=(500, None), cardData=True)
len(models)
>>> 10

Original source

This story was published by Hugging Face Blog. SyncAI.news shows a preview; the complete article is on the publisher's site.

Read the full story on huggingface.co

Similar News