# Using & Mixing Hugging Face Models with Gradio 2.0

huggingface.co · Abubakar Abid · May 25, 2021

**Type:** Announcement

## Summary

The Hugging Face Model Hub hosts more than 10,000 user-submitted machine learning models spanning natural language processing, image classification, and audio processing. Machine learning developers increasingly need to demo models to interdisciplinary collaborators or non-programmers to uncover biases and failure points. The Gradio 2.0 library enables users to create graphical user interfaces and load almost any Hugging Face model using a single line of code. By default, these interfaces query Hugging Face's hosted Inference API without requiring an API key, though users can also run computations locally via the transformers library. Gradio interfaces can be customized through the Interface class and composed to load multiple models in parallel or chain them in series.

## Context

Machine learning models need to be shared and demoed to interdisciplinary teams and non-programmers to help uncover biases and failure points, but programmatic interfaces typically restrict model interactions to software developers.

## Approach / What changed

Gradio 2.0 integrates with the Hugging Face Model Hub to generate model GUIs in one line of code, using either Hugging Face's hosted Inference API or local execution via transformers, while supporting custom Interface parameters and model compositions in parallel or series.

## Takeaways

- Gradio 2.0 allows loading almost any model from the Hugging Face Model Hub into a shareable GUI with a single line of code.
- Inference runs by default through Hugging Face's hosted Inference API without requiring an API key, or locally by installing the transformers library.
- Developers can compose models within Gradio by executing them in parallel for side-by-side comparison or chaining them in series for multi-step tasks.

**Tags:** [Developer Experience](https://yomu.fyi/topic/developer-experience), [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/gradio)
