Transform Your ML Models into Interactive Web Apps with Gradio
What is Gradio?
Gradio is an open-source Python package that enables quick construction of demos or web applications for machine learning models, APIs, or any Python function.
It also provides built-in sharing features for easy distribution, requiring no JavaScript, CSS, or web hosting experience.
It is used by big players such as Google, Facebook, Amazon, Cisco, VMWare, SIEMENS, and more.
It works well with Python web frameworks such as Flask and Django.
How does it work?
Gradio allows Machine Learning engineers to quickly create web interfaces for machine learning models. It is compatible with any Python library and can be installed using pip.
Gradio interfaces can be embedded in Python notebooks or presented as webpages, and can generate public links for remote interaction. Interfaces can also be permanently hosted on Hugging Face Spaces.
Install
pip install gradio
Build Your First Demo
You can run Gradio in your favorite code editor, Jupyter notebook, Google Colab, or anywhere else you write Python. Let's write your first Gradio app:
import gradio as gr
def greet(name, intensity):
return "Hello " * intensity + name + "!"
demo = gr.Interface(
fn=greet,
inputs=["text", "slider"],
outputs=["text"],
)
demo.launch()
License
Apache-2.0 License