Sujatha commited on
Commit
e798fc2
·
verified ·
1 Parent(s): ec17f61

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
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()