tommy24 commited on
Commit
0af7025
·
1 Parent(s): 013b6e1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from flask import request
3
+
4
+ def greet(name):
5
+ if request.path == "/api":
6
+ return "Hello, " + name + "!"
7
+ else:
8
+ return "Hello, World!"
9
+
10
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text", title="Greeting App", description="Enter your name and get a greeting!")
11
+
12
+ iface.launch()