Close Menu
    Latest Post

    Anker’s X1 Pro shouldn’t exist, but I’m so glad it does

    February 22, 2026

    Suspected Russian Actor Linked to CANFAIL Malware Attacks on Ukrainian Organizations

    February 22, 2026

    Trump Reinstates De Minimis Exemption Suspension Despite Supreme Court Ruling

    February 22, 2026
    Facebook X (Twitter) Instagram
    Trending
    • Anker’s X1 Pro shouldn’t exist, but I’m so glad it does
    • Suspected Russian Actor Linked to CANFAIL Malware Attacks on Ukrainian Organizations
    • Trump Reinstates De Minimis Exemption Suspension Despite Supreme Court Ruling
    • How Cloudflare Mitigated a Vulnerability in its ACME Validation Logic
    • Demis Hassabis and John Jumper Receive Nobel Prize in Chemistry
    • How to Cancel Your Google Pixel Watch Fitbit Premium Trial
    • GHD Speed Hair Dryer Review: Powerful Performance and User-Friendly Design
    • An FBI ‘Asset’ Helped Run a Dark Web Site That Sold Fentanyl-Laced Drugs for Years
    Facebook X (Twitter) Instagram Pinterest Vimeo
    NodeTodayNodeToday
    • Home
    • AI
    • Dev
    • Guides
    • Products
    • Security
    • Startups
    • Tech
    • Tools
    NodeTodayNodeToday
    Home»AI»Welcome fastai to the Hugging Face Hub
    AI

    Welcome fastai to the Hugging Face Hub

    Samuel AlejandroBy Samuel AlejandroJanuary 18, 2026No Comments7 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    src ou592e featured
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Making neural nets uncool again… and sharing them

    The fast.ai ecosystem has significantly contributed to making Deep Learning accessible. The mission at Hugging Face is to democratize good Machine Learning. This involves making exclusivity in access to Machine Learning, including pre-trained models, a thing of the past to advance this amazing field even further.

    fastai is an open-source Deep Learning library that leverages PyTorch and Python to provide high-level components for training fast and accurate neural networks with state-of-the-art outputs on text, vision, and tabular data. Beyond just a library, fast.ai has grown into a thriving ecosystem of open source contributors and individuals learning about neural networks. Examples include their book and courses. Engaging with the fast.ai Discord and forums is a guaranteed way to learn by being part of their community!

    Because of these contributions, fastai practitioners can now share and upload models to the Hugging Face Hub with a single line of Python. This post introduces the integration between fastai and the Hub. Additionally, this tutorial can be opened as a Colab notebook.

    Appreciation is extended to the fast.ai community, notably Jeremy Howard, Wayde Gilliam, and Zach Mueller for their feedback. This blog post is heavily inspired by the Hugging Face Hub section in the fastai docs.

    Why share to the Hub?

    The Hub is a central platform where anyone can share and explore models, datasets, and ML demos. It features the most extensive collection of Open Source models, datasets, and demos.

    Sharing on the Hub amplifies the impact of fastai models by making them available for others to download and explore. Transfer learning can also be utilized with fastai models; another user’s model can be loaded as the basis for a new task.

    All fastai models in the Hub are accessible by filtering the hf.co/models webpage by the fastai library, as shown in the image below.

    Fastai Models in the Hub

    In addition to free model hosting and exposure to the broader community, the Hub includes built-in version control based on git (git-lfs, for large files) and model cards for discoverability and reproducibility. For more information on navigating the Hub, refer to this introduction.

    Joining Hugging Face and installation

    To share models in the Hub, a user account is required. This can be created on the Hugging Face website.

    The huggingface_hub library is a lightweight Python client with utility functions to interact with the Hugging Face Hub. To push fastai models to the hub, certain libraries must be pre-installed (fastai>=2.4, fastcore>=1.3.27 and toml). These can be installed automatically by specifying [“fastai”] when installing huggingface_hub, preparing the environment for use:

    pip install huggingface_hub["fastai"]
    

    Creating a fastai Learner

    This section demonstrates training the first model in the fastbook to identify cats 🐱. Reading the entire fastbook is highly recommended.

    # Training of 6 lines in chapter 1 of the fastbook.
    from fastai.vision.all import *
    path = untar_data(URLs.PETS)/'images'
    
    def is_cat(x): return x[0].isupper()
    dls = ImageDataLoaders.from_name_func(
        path, get_image_files(path), valid_pct=0.2, seed=42,
        label_func=is_cat, item_tfms=Resize(224))
    
    learn = vision_learner(dls, resnet34, metrics=error_rate)
    learn.fine_tune(1)
    

    Sharing a Learner to the Hub

    A Learner is a fastai object that bundles a model, data loaders, and a loss function. The words Learner and Model will be used interchangeably throughout this post.

    First, log in to the Hugging Face Hub. A write token will need to be created in your Account Settings. There are three options to log in:

    1. Type huggingface-cli login in your terminal and enter your token.

    2. If in a python notebook, notebook_login can be used.

    from huggingface_hub import notebook_login
    
    notebook_login()
    
    1. The token argument of the push_to_hub_fastai function can be used.

    The push_to_hub_fastai function accepts the Learner to be uploaded and the repository id for the Hub in the format of “namespace/repo_name”. The namespace can be an individual account or an organization with write access (for example, ‘fastai/stanza-de’). For more details, refer to the Hub Client documentation.

    from huggingface_hub import push_to_hub_fastai
    
    # repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
    repo_id = "espejelomar/identify-my-cat"
    
    push_to_hub_fastai(learner=learn, repo_id=repo_id)
    

    The Learner is now in the Hub in the repo named espejelomar/identify-my-cat. An automatic model card is created with some links and next steps. When uploading a fastai Learner (or any other model) to the Hub, it is helpful to edit its model card so that others better understand the work (refer to the Hugging Face documentation).

    If you want to learn more about push_to_hub_fastai, go to the Hub Client Documentation. There are some useful arguments you might be interested in. Remember, your model is a Git repository with all the advantages that this entails: version control, commits, branches…

    Loading a Learner from the Hugging Face Hub

    Loading a model from the Hub is even simpler. The Learner, “espejelomar/identify-my-cat”, will be loaded and tested with a cat image (🦮?). This code is adapted from the first chapter of the fastbook.

    First, upload an image of a cat (or possibly a dog?). The Colab notebook with this tutorial uses ipywidgets to interactively upload a cat image (or not?). Here, a cute cat 🐅 is used:

    Now, the Learner previously shared in the Hub is loaded and tested.

    from huggingface_hub import from_pretrained_fastai
    
    # repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
    repo_id = "espejelomar/identify-my-cat"
    
    learner = from_pretrained_fastai(repo_id)
    

    It works 👇!

    _,_,probs = learner.predict(img)
    print(f"Probability it's a cat: {100*probs[1].item():.2f}%")
    
    Probability it's a cat: 100.00%
    

    The Hub Client documentation includes additional details on from_pretrained_fastai.

    Blurr to mix fastai and Hugging Face Transformers (and share them)!

    Blurr is a library designed for fastai developers who want to train and deploy Hugging Face transformers – Blurr Docs.

    The process involves:

    1. Training a blurr Learner with the high-level Blurr API. It will load the distilbert-base-uncased model from the Hugging Face Hub and prepare a sequence classification model.
    2. Sharing it to the Hub with the namespace fastai/blurr_IMDB_distilbert_classification using push_to_hub_fastai.
    3. Loading it with from_pretrained_fastai and trying it with learner_blurr.predict().

    Collaboration and open-source are fantastic!

    First, install blurr and train the Learner.

    git clone https://github.com/ohmeow/blurr.git
    cd blurr
    pip install -e ".[dev]"
    
    import torch
    import transformers
    from fastai.text.all import *
    
    from blurr.text.data.all import *
    from blurr.text.modeling.all import *
    
    path = untar_data(URLs.IMDB_SAMPLE)
    model_path = Path("models")
    imdb_df = pd.read_csv(path / "texts.csv")
    
    learn_blurr = BlearnerForSequenceClassification.from_data(imdb_df, "distilbert-base-uncased", dl_kwargs={"bs": 4})
    learn_blurr.fit_one_cycle(1, lr_max=1e-3)
    

    Use push_to_hub_fastai to share with the Hub.

    from huggingface_hub import push_to_hub_fastai
    
    # repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
    repo_id = "fastai/blurr_IMDB_distilbert_classification"
    
    push_to_hub_fastai(learn_blurr, repo_id)
    

    Use from_pretrained_fastai to load a blurr model from the Hub.

    from huggingface_hub import from_pretrained_fastai
    
    # repo_id = "YOUR_USERNAME/YOUR_LEARNER_NAME"
    repo_id = "fastai/blurr_IMDB_distilbert_classification"
    
    learner_blurr = from_pretrained_fastai(repo_id)
    

    Try it with a couple sentences and review their sentiment (negative or positive) with learner_blurr.predict().

    sentences = ["This integration is amazing!",
                 "I hate this was not available before."]
    
    probs = learner_blurr.predict(sentences)
    
    print(f"Probability that sentence '{sentences[0]}' is negative is: {100*probs[0]['probs'][0]:.2f}%")
    print(f"Probability that sentence '{sentences[1]}' is negative is: {100*probs[1]['probs'][0]:.2f}%")
    

    Again, it works!

    Probability that sentence 'This integration is amazing!' is negative is: 29.46%
    Probability that sentence 'I hate this was not available before.' is negative is: 70.04%
    

    What’s next?

    Consider taking the fast.ai course (a new version is coming soon), follow Jeremy Howard and fast.ai on Twitter for updates, and start sharing your fastai models on the Hub. Alternatively, load one of the models that are already in the Hub.

    For project ideas or feedback, contact is available via the Hugging Face Discord.

    Would you like to integrate your library to the Hub?

    This integration is made possible by the huggingface_hub library. If you want to add your library to the Hub, a guide is available for you! Or simply tag someone from the Hugging Face team.

    A shout out to the Hugging Face team for all the work on this integration, in particular @osanseviero 🦙.

    Thank you fastlearners and hugging learners.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleWhat’s !important #3: Popover Context Menus, @scope, New Web Platform Features, and More
    Next Article Copilot SDK Now Available in Technical Preview
    Samuel Alejandro

    Related Posts

    AI

    Demis Hassabis and John Jumper Receive Nobel Prize in Chemistry

    February 21, 2026
    AI

    SIMA 2: An Agent that Plays, Reasons, and Learns With You in Virtual 3D Worlds

    February 19, 2026
    AI

    Sarvam AI Unveils New Open-Source Models, Betting on Efficiency and Local Relevance

    February 18, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Latest Post

    ChatGPT Mobile App Surpasses $3 Billion in Consumer Spending

    December 21, 202513 Views

    Creator Tayla Cannon Lands $1.1M Investment for Rebuildr PT Software

    December 21, 202511 Views

    Automate Your iPhone’s Always-On Display for Better Battery Life and Privacy

    December 21, 202510 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram
    About

    Welcome to NodeToday, your trusted source for the latest updates in Technology, Artificial Intelligence, and Innovation. We are dedicated to delivering accurate, timely, and insightful content that helps readers stay ahead in a fast-evolving digital world.

    At NodeToday, we cover everything from AI breakthroughs and emerging technologies to product launches, software tools, developer news, and practical guides. Our goal is to simplify complex topics and present them in a clear, engaging, and easy-to-understand way for tech enthusiasts, professionals, and beginners alike.

    Latest Post

    Anker’s X1 Pro shouldn’t exist, but I’m so glad it does

    February 22, 20260 Views

    Suspected Russian Actor Linked to CANFAIL Malware Attacks on Ukrainian Organizations

    February 22, 20260 Views

    Trump Reinstates De Minimis Exemption Suspension Despite Supreme Court Ruling

    February 22, 20260 Views
    Recent Posts
    • Anker’s X1 Pro shouldn’t exist, but I’m so glad it does
    • Suspected Russian Actor Linked to CANFAIL Malware Attacks on Ukrainian Organizations
    • Trump Reinstates De Minimis Exemption Suspension Despite Supreme Court Ruling
    • How Cloudflare Mitigated a Vulnerability in its ACME Validation Logic
    • Demis Hassabis and John Jumper Receive Nobel Prize in Chemistry
    Facebook X (Twitter) Instagram Pinterest
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    • Disclaimer
    • Cookie Policy
    © 2026 NodeToday.

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