Running PyTorch Hub Models in Your Browser (with Gradio)*roUeNIyFWqGDA2jB

Original Source Here

This is where the Gradio library comes in. The open-source Python library (with more than 2,500 stars) lets machine learning developers create demos and GUIs from models very easily, and share them for free with collaborators as easily as sharing a Google docs link.

We’re excited to share that many of the models on PyTorch Hub now include a button that lets you create a Gradio demo so that anyone can use the model to make predictions without needing to write any code. Above is an example of a Gradio demo for an bird image classification model.

Gradio’s library is quite flexible and can handle different types of models. Here is another interface for a speech-to-text model.

A Gradio interface for a speech-to-text model

With the Gradio library, you can test the model with your own voice, and so can your teammates/users/testers/customers.

What does the code look like to generate this GUI? Just 3 lines of code (See the notebook for yourself)

Given the ease of creating these demos, we decided to incorporate them into PyTorch Hub itself. To create a demo like this, simply click on the “Demo Model Output” button next on the model page for models on PyTorch Hub:

Click this button to open a Colab notebook & then click Runtime > Run all

This launches a Colab notebook with the code above. You can edit the code to customize the GUI that is created, or simply click “Runtime > Run all” to launch the GUI. You can even create a shareable link allowing you to send the GUI to teammates and collaborators.

Launching the Silero Speech-to-Text Model Demo

And that’s it! We hope you find PyTorch Hub models even easier to use through Gradio.

We would like to thank the PyTorch team for integrating Gradio into the PyTorch Hub and creating this amazing experience for programmers and non-programmers alike!


Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: