File size: 454 Bytes
e798fc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr

# Function to calculate the square of a number
def square_number(number):
    return number ** 2

# Gradio interface
interface = gr.Interface(
    fn=square_number,  # Function to call
    inputs="number",   # Input type (numeric input)
    outputs="number",  # Output type (numeric output)
    title="Number Squarer",
    description="Enter a number, and the app will return its square!"
)

# Launch the interface
interface.launch()