Hugging FaceAbubakar AbidAnnouncement
Using & Mixing Hugging Face Models with Gradio 2.0
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.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.