# Welcome fastai to the Hugging Face Hub

huggingface.co · Omar Espejel · May 6, 2022

**Type:** Tutorial

## Summary

Hugging Face Hub has integrated with the fastai deep learning library, allowing practitioners to upload and download models directly through the huggingface\_hub Python client. Fastai Learner objects, which bundle model architectures, data loaders, and loss functions, can be published to a designated repository namespace using push\_to\_hub\_fastai. Uploaded models automatically receive Git-based version control, Git LFS support for large files, and generated model cards. Practitioners can retrieve and instantiate published models locally for inference or transfer learning via from\_pretrained\_fastai. The integration also supports Blurr, an ecosystem library that combines fastai with Hugging Face Transformers for sequence classification and related text modeling tasks.

## Context

Fastai practitioners needed a streamlined way to publicly share, discover, version-control, and load trained Learner models and transfer learning weights within the broader machine learning community.

## Approach / What changed

Hugging Face introduced integration utilities in the huggingface\_hub Python library, adding push\_to\_hub\_fastai and from\_pretrained\_fastai functions to enable single-line uploading and downloading of fastai and Blurr models.

## Takeaways

- Fastai Learner models can be published to the Hugging Face Hub using push\_to\_hub\_fastai after authenticating via token, CLI, or notebook\_login.
- Hosted fastai models on the Hub automatically include Git-based version control with Git LFS for large file storage and auto-generated model cards.
- The from\_pretrained\_fastai function downloads Hub models directly into local fastai Learner instances, supporting standard vision models as well as Blurr Transformer pipelines.

**Tags:** [Machine Learning](https://yomu.fyi/topic/machine-learning), [Open Source](https://yomu.fyi/topic/open-source), [Python](https://yomu.fyi/topic/python)

[Read original post](https://huggingface.co/blog/fastai)
