




Interfaces for your ML Models
Gradio allows you to quickly create customizable UI components around your TensorFlow or PyTorch models, or even arbitrary Python functions. Mix and match components to support any combination of inputs and outputs. Our core library is free and open-source!
Below are a few demos. Check the Getting Started for full code examples.
import gradio as gr
def recognize_digit(img):
# ... implement digit recognition model on input array
# ... return dictionary of labels and confidences
gr.Interface(fn=recognize_digit, inputs="sketchpad", outputs="label").launch()
import gradio as gr
def answer_question(paragraph, question):
# ... implement Q&A model
# ... return answer to question
gr.Interface(fn=answer_question, inputs=["textbox", "text"], outputs="text").launch()
import gradio as gr
def face_segmentation(img):
# ... implement face segmentation model on input 200x200 numpy array
# ... return segmentation mask as numpy array
webcam = gr.in.Webcam(shape=(200, 200))
gr.Interface(fn=face_segmentation, inputs=webcam, outputs="image").launch()
import gradio as gr, matplotlib.pyplot as plt
def outbreak_forecast(r, month, countries, social_distancing):
# ... run model to forecast outbreak and generate plots
# ... return plt
r = gr.in.Slider(1, 5)
month = gr.in.Dropdown(["May", "June", "July"])
countries = gr.in.CheckboxGroup(["USA", "Canada", "Mexico", "UK"])
gr.Interface(fn=outbreak_forecast,
inputs=[r, month, countries, "checkbox"], outputs="plot").launch()






Fast, easy setup
Gradio can be installed directly through pip. Creating a Gradio interface only requires adding a couple lines of code to your project. You can choose from a variety of interface types to interface your function.
More on Getting Started >>
Present and share
Gradio can be embedded in Python notebooks or presented as a webpage. A Gradio interface can automatically generate a public link you can share with colleagues that lets them interact with the model on your computer remotely from their own devices.
More on Sharing >>
Permanent hosting
Once you've created an interface, you can point Gradio towards the GitHub repository where it is contained. Gradio will host the interface on its servers and provide you with a link you can share.
More on Hosting >>







Pro Tip:
— Ramsri Goutham Golla (@ramsri_goutham) January 27, 2021
You built a nice ML model in Colab and want to show it to your Product manager?
With @GradioML you can create an easy GUI for your ML model.
Share the GUI via a simple link (eg:https://t.co/UUb9rDpYRj) to your non-tech manager.#NLProc #MachineLearning #DataScience pic.twitter.com/r7i6n2Vmff
Dear #MachineLearning twitter,
— Vinay Prabhu (@vinayprabhu) November 5, 2020
If you haven't typed:
$ πππ πππππππ ππππππ
yet, now would be a damn good time.
Especially if you are working in computer vision & deploying models in the real world. https://t.co/ND4WKaOF8u
Pretty neat that @GradioML! ππ₯
— Charly Wargnier (@DataChaz) January 18, 2021
+ Generate an easy-to-use UI for your #ML model, function, or #API with only a few lines of code!
+ Integrate directly into your @ProjectJupyter notebook
+ or share a link with anyone
h/t @VincentTerrasi #MachineLearning https://t.co/8Gpar1B8vf
Check out this cool python library! @GradioML lets you *easily* create web-based interfaces for your ML models https://t.co/ycDb5IoMHJ
— M. Usman Rafique (@m_usmanrafique) December 18, 2020
A Visual History of Interpretation for Image Recognition.
— Reza Zadeh (@Reza_Zadeh) November 27, 2020
Blog: https://t.co/rY59v0FAZR
Code: https://t.co/rD8PqGAUnB pic.twitter.com/iwVrLxqhTe
Having @GradioML deploy your model is like a test-of-time award, except itβs test-of-now. Open implementation, clear code, and actionable dataset has to skew towards better papers. https://t.co/aBDu3Qh1Mg
— David Ouyang, MD (@David_Ouyang) December 15, 2020
After more than 8 years of using python, finally, I had the chance to give back to the community during the #PyConID2020 event. I shared a message for my fellow data scientists in the lightning talk session and why they should check out @GradioML: https://t.co/iSbODtFLbH
— Yosef Ardhito (@yoseflaw) November 16, 2020
One again, 5 lines of Python code + amazing @GradioML
— Vinay Prabhu (@vinayprabhu) October 9, 2020
results in a more nuanced understanding on the brittleness of a real-world deployed ML model.
Colab or didn't happen? Here: https://t.co/acTCmHyMQ5 pic.twitter.com/9olqMQlSc3
Just create a web UI for Drug-Target Interaction Prediction with less than 10 lines using DeepPurpose and @GradioML π Very impressed with Gradio's simplicity! https://t.co/Xxv574YEGo pic.twitter.com/ghR01lHtUK
— Kexin Huang (@KexinHuang5) July 20, 2020
I just discovered Gradio. It's a nice tool for a quick test and execution of your ML models.
— Sahbi Chaieb (@sahbichaieb) September 28, 2020
It works for structured data, text and images. #MLOps https://t.co/o06Iz1W4x9
This looks really cool! @GradioML gives you a really easy way to build a simple interface on top of machine learning models. Looking forward to having a play with it and maybe using it in my live streams.
— Matt Hamilton (@HammerToe) July 17, 2020
instant model sharing? Get your deep learning models out there fast! https://t.co/1XXJW6o8BK pic.twitter.com/JZrAUIoeoa
— Andrew Carr (@andrew_n_carr) July 10, 2020
Contact Us.
Have questions, or want to integrate Gradio in a large team? Get in touch.
Running into any technical issues? Open an issue at our github repo.