Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|