Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
-
from flask import
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def greet(name):
|
5 |
-
|
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()
|
13 |
-
iface.run_in_browser()
|
|
|
1 |
import gradio as gr
|
2 |
+
from flask import Flask
|
3 |
+
|
4 |
+
app = Flask(__name__)
|
5 |
+
|
6 |
+
@app.route("/api")
|
7 |
+
def api_greet(name):
|
8 |
+
return "Hello, " + name + "!"
|
9 |
|
10 |
def greet(name):
|
11 |
+
return "Hello, World!"
|
|
|
|
|
|
|
12 |
|
13 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text", title="Greeting App", description="Enter your name and get a greeting!")
|
14 |
|
15 |
iface.launch()
|
16 |
+
iface.run_in_browser(app=app)
|