Close Menu
techwavedispatch.com

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    5 Emerging Technologies That May Soon Become Part Of Everyday Life

    November 15, 2026

    Machine Learning Experts – Lewis Tunstall

    November 15, 2026

    Why Do Some USB Connectors Have Those 2 Square Holes?

    November 15, 2026
    Facebook X (Twitter) Instagram
    Trending
    • 5 Emerging Technologies That May Soon Become Part Of Everyday Life
    • Machine Learning Experts – Lewis Tunstall
    • Why Do Some USB Connectors Have Those 2 Square Holes?
    • CO2 Emissions and the 🤗 Hub: Leading the Charge
    • Vibe Coding Is Changing How Musicians Customize Their Gear
    • Introducing Hugging Face for Education 🤗
    • iPhone Duo Vs Oppo Find N6: How These Foldables Compare
    • Supercharged Customer Service with Machine Learning
    Facebook X (Twitter) Instagram
    techwavedispatch.com
    Subscribe
    Sunday, November 15
    • Home
    • AI Tools & Software
    • Machine Learning
    • Generative AI
    • Robotics & Automation
    • Future Tech & Hardware
    • AI in Business
    • Ethics & Regulations
    • More
      • Gadgets & Smart Devices
      • Cybersecurity & AI
      • Tech Breakthroughs
    techwavedispatch.com
    Home»AI Tools & Software»CO2 Emissions and the 🤗 Hub: Leading the Charge
    AI Tools & Software

    CO2 Emissions and the 🤗 Hub: Leading the Charge

    adminBy adminNovember 15, 2026No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    CO2 Emissions and the 🤗 Hub: Leading the Charge
    Share
    Facebook Twitter LinkedIn Pinterest Email



    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.

    Image of recent Transformer models and their carbon footprints

    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:

    model = models[0]
    print(f'Model Name: {model.modelId}\nCO2 Emitted during training: {model.cardData["co2_eq_emissions"]}')
    
    >>> Model Name: esiebomajeremiah/autonlp-email-classification-657119381
        CO2 Emitted during training: 3.516233232503715
    

    Similarly, we can search for a minimum value to find very large models that emitted a lot of CO2 during training:

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

    Now let’s see exactly how much CO2 one of these emitted:

    model = models[0]
    print(f'Model Name: {model.modelId}\nCO2 Emitted during training: {model.cardData["co2_eq_emissions"]}')
    
    >>> Model Name: Maltehb/aelaectra-danish-electra-small-cased
        CO2 Emitted during training: 4009.5
    

    That’s a lot of CO2!

    As you can see, in just a few lines of code we can quickly vet models we may want to use to make sure we’re being environmentally cognizant!



    How to Report Your Carbon Emissions with transformers

    If you’re using transformers, you can automatically track and report carbon emissions thanks to the codecarbon integration. If you’ve installed codecarbon on your machine, the Trainer object will automatically add the CodeCarbonCallback while training, which will store carbon emissions data for you as you train.

    So, if you run something like this…

    from datasets import load_dataset
    from transformers import AutoModelForSequenceClassification, AutoTokenizer, Trainer, TrainingArguments
    ​
    ds = load_dataset("imdb")
    model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=2)
    tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
    ​
    def tokenize_function(examples):
        return tokenizer(examples["text"], padding="max_length", truncation=True)
    ​
    ​
    small_train_dataset = ds["train"].shuffle(seed=42).select(range(1000)).map(tokenize_function, batched=True)
    small_eval_dataset = ds["test"].shuffle(seed=42).select(range(1000)).map(tokenize_function, batched=True)
    ​
    ​
    training_args = TrainingArguments(
        "codecarbon-text-classification",
        num_train_epochs=4,
        push_to_hub=True
    )
    ​
    trainer = Trainer(
        model=model,
        args=training_args,
        train_dataset=small_train_dataset,
        eval_dataset=small_eval_dataset,
    )
    ​
    trainer.train()
    

    …you’ll be left with a file within the codecarbon-text-classification directory called emissions.csv. This file will keep track of the carbon emissions across different training runs. Then, when you’re ready, you can take the emissions from the run you used to train your final model and include that in its model card. 📝

    An example of this data being included at the top of the model card is shown below:

    Visual of organizing the co2_eq_emissions in a Model Card file

    For more references on the metadata format for co2_eq_emissions see the hub docs.



    Further readings

    Charge CO2 emissions Hub Leading
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Machine Learning Experts – Lewis Tunstall

    November 15, 2026

    Introducing Hugging Face for Education 🤗

    November 15, 2026

    Supercharged Customer Service with Machine Learning

    November 15, 2026
    Leave A Reply Cancel Reply

    Top Posts

    NVIDIA Is Investigating Reports That CEO Jensen Huang Was The Target Of Chinese Spy Efforts

    November 8, 202619 Views

    ADIndex: Layer-Adaptive Sparse Attention Indexing via Group-Level Distillation

    November 11, 20265 Views

    Anthropic releases new Mythos and Fable models amid RSI concerns

    November 9, 20265 Views

    One Policy for 100 Household Tasks: Our Solution for the 2026 BEHAVIOR Challenge

    November 11, 20264 Views
    Don't Miss
    Gadgets & Smart Devices

    5 Emerging Technologies That May Soon Become Part Of Everyday Life

    By adminNovember 15, 20260

    Some are already on your phone; others are tied up in regulatory hell. …

    Machine Learning Experts – Lewis Tunstall

    November 15, 2026

    Why Do Some USB Connectors Have Those 2 Square Holes?

    November 15, 2026

    CO2 Emissions and the 🤗 Hub: Leading the Charge

    November 15, 2026
    About Us

    Welcome to TechWave Dispatch

    At TechWave Dispatch, we bring you the latest news, insights, and developments from the ever-evolving world of technology. Our mission is to keep readers informed about the innovations shaping our digital future.

    From artificial intelligence and machine learning to cybersecurity, robotics, smart devices, and groundbreaking technologies, we cover the topics that matter in today's fast-moving tech landscape.

    Our Picks

    5 Emerging Technologies That May Soon Become Part Of Everyday Life

    November 15, 2026

    Machine Learning Experts – Lewis Tunstall

    November 15, 2026

    Why Do Some USB Connectors Have Those 2 Square Holes?

    November 15, 2026
    Most Popular

    After blocking Muse, Amazon now lets users text Alexa to help them shop

    November 6, 20260 Views

    A controlled world for robot learning and evaluation

    November 6, 20260 Views

    Perplexity now has its own always-on AI agent

    November 6, 20260 Views
    Facebook X (Twitter) Instagram Pinterest
    • Terms and Conditions
    • Privacy Policy
    • Contact Us
    • About Us
    © 2026 TechWave Dispatch. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.