Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from flask import request
|
3 |
|
4 |
def greet(name):
|
5 |
-
if request.path
|
6 |
return "Hello, " + name + "!"
|
7 |
else:
|
8 |
return "Hello, World!"
|
@@ -10,3 +10,4 @@ def greet(name):
|
|
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()
|
|
|
|
2 |
from flask import request
|
3 |
|
4 |
def greet(name):
|
5 |
+
if request.path.startswith("/api"):
|
6 |
return "Hello, " + name + "!"
|
7 |
else:
|
8 |
return "Hello, World!"
|
|
|
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()
|