DEMO 1-1: Build Your First Gradio App

import gradio as gr

def greet(name, intensity): # Define a simple function that returns a greeting message
    return "Hello, " + name + "!" * int(intensity)

# Define the Gradio interface with the following specifications:
demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"], # Define the inputs as text and a slider
    outputs=["text"], # Define the output as text
) 

demo.launch() # Launch the Gradio interface in the default web browser