Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,25 +57,17 @@ def exam_calendar(selected_date=None):
|
|
| 57 |
"""
|
| 58 |
|
| 59 |
# Gradio App Interface
|
| 60 |
-
def app_interface(
|
| 61 |
-
route
|
| 62 |
-
|
| 63 |
-
if route == "exam_calendar":
|
| 64 |
-
if request.method == "POST":
|
| 65 |
-
selected_date = request.POST.get('selected_date')
|
| 66 |
-
return exam_calendar(selected_date)
|
| 67 |
-
else:
|
| 68 |
-
return exam_calendar()
|
| 69 |
else:
|
| 70 |
return home()
|
| 71 |
|
| 72 |
# Launching the Gradio interface
|
| 73 |
iface = gr.Interface(
|
| 74 |
fn=app_interface,
|
| 75 |
-
inputs=
|
| 76 |
-
outputs="html"
|
| 77 |
-
server_name="localhost",
|
| 78 |
-
server_port=7860
|
| 79 |
)
|
| 80 |
|
| 81 |
iface.launch()
|
|
|
|
| 57 |
"""
|
| 58 |
|
| 59 |
# Gradio App Interface
|
| 60 |
+
def app_interface(route="/"):
|
| 61 |
+
if route == "/exam_calendar":
|
| 62 |
+
return exam_calendar()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
else:
|
| 64 |
return home()
|
| 65 |
|
| 66 |
# Launching the Gradio interface
|
| 67 |
iface = gr.Interface(
|
| 68 |
fn=app_interface,
|
| 69 |
+
inputs=gr.inputs.Textbox(lines=1, default="/", label="Route"),
|
| 70 |
+
outputs="html"
|
|
|
|
|
|
|
| 71 |
)
|
| 72 |
|
| 73 |
iface.launch()
|