Building AI Apps with Hugging Face Spaces and Gradio

By the end of this course, learners will be able to: • Load and preprocess HF Hub datasets, fine-tune a pre-trained model with the Trainer API, compute evaluation metrics, and push the result to the Hub with a model card. • Build interactive AI applications using gr.Interface and gr.Blocks with multi-component layouts, conditional visibility, session state, and event listeners • Build a streaming multi-turn chatbot using gr.ChatInterface with an LLM backend and extend it with real-time inference workflows. • Deploy a Gradio app to HF Spaces, configure hardware and secrets, evaluate cost vs. performance trade-offs, and query the deployed app programmatically using the Gradio Python client. A model stuck in a notebook is a model nobody uses. Some familiarity with the HF Transformers library and pipeline API will help you hit the ground running. The course starts where most tutorials stop — with the data. Work through a realistic fine-tuning scenario: the off-the-shelf classifier isn’t cutting it for your domain, so you’ll load a dataset from the Hub, preprocess it with the right tokenization strategy, configure the Trainer API, evaluate with real metrics, and publish the result with a model card.

Once you have a model that works for your domain, the next question is: how do people use it? Wrap it in a Gradio app, graduate from quick prototypes with gr.Interface to structured applications with gr.Blocks, and add streaming chatbot behavior with gr.ChatInterface — including diagnosing why a chatbot demo feels broken the day before a client presentation. Deploy everything to Hugging Face Spaces, configure ZeroGPU when the budget won’t cover dedicated hardware, and turn your app into a programmable API endpoint. By the end, you’ll have a fine-tuned model and a live, deployed application that other systems can call.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.