Spaces:
Sleeping
Sleeping
Commit ·
8115e25
1
Parent(s): 10ed4b7
fix reset endpoint routing for validator
Browse files- server/app.py +7 -3
server/app.py
CHANGED
|
@@ -13,6 +13,7 @@ import numpy as np
|
|
| 13 |
import matplotlib.pyplot as plt
|
| 14 |
from env.environment import CloudResourceEnv
|
| 15 |
from env.grader import EpisodeGrader
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
# Initialize environment and grader
|
|
@@ -479,11 +480,14 @@ app = FastAPI()
|
|
| 479 |
|
| 480 |
@app.post("/reset")
|
| 481 |
async def reset_endpoint():
|
| 482 |
-
"""Reset endpoint for validator compliance."""
|
| 483 |
return {"status": "ok"}
|
| 484 |
|
| 485 |
-
|
| 486 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 487 |
|
| 488 |
|
| 489 |
def main():
|
|
|
|
| 13 |
import matplotlib.pyplot as plt
|
| 14 |
from env.environment import CloudResourceEnv
|
| 15 |
from env.grader import EpisodeGrader
|
| 16 |
+
from fastapi.responses import RedirectResponse
|
| 17 |
|
| 18 |
|
| 19 |
# Initialize environment and grader
|
|
|
|
| 480 |
|
| 481 |
@app.post("/reset")
|
| 482 |
async def reset_endpoint():
|
|
|
|
| 483 |
return {"status": "ok"}
|
| 484 |
|
| 485 |
+
@app.get("/")
|
| 486 |
+
def root():
|
| 487 |
+
return RedirectResponse(url="/ui")
|
| 488 |
+
|
| 489 |
+
app = gr.mount_gradio_app(app, demo, path="/ui")
|
| 490 |
+
|
| 491 |
|
| 492 |
|
| 493 |
def main():
|