Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Function to calculate the square of a number
|
4 |
+
def square_number(number):
|
5 |
+
return number ** 2
|
6 |
+
|
7 |
+
# Gradio interface
|
8 |
+
interface = gr.Interface(
|
9 |
+
fn=square_number, # Function to call
|
10 |
+
inputs="number", # Input type (numeric input)
|
11 |
+
outputs="number", # Output type (numeric output)
|
12 |
+
title="Number Squarer",
|
13 |
+
description="Enter a number, and the app will return its square!"
|
14 |
+
)
|
15 |
+
|
16 |
+
# Launch the interface
|
17 |
+
interface.launch()
|