fix:redirect to ui
Browse files- app.py +6 -0
- env_server.py +1 -1
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from models import Action
|
|
| 7 |
import gradio as gr
|
| 8 |
import traceback
|
| 9 |
import uvicorn
|
|
|
|
| 10 |
|
| 11 |
load_dotenv()
|
| 12 |
|
|
@@ -85,5 +86,10 @@ with gr.Blocks(title="CUDA Kernel Optimizer") as demo:
|
|
| 85 |
app = gr.mount_gradio_app(openenv_app, demo, path="/ui")
|
| 86 |
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
if __name__ == "__main__":
|
| 89 |
uvicorn.run("app:app", host="0.0.0.0", port=int(os.getenv("PORT", "7860")))
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
import traceback
|
| 9 |
import uvicorn
|
| 10 |
+
from fastapi.responses import RedirectResponse
|
| 11 |
|
| 12 |
load_dotenv()
|
| 13 |
|
|
|
|
| 86 |
app = gr.mount_gradio_app(openenv_app, demo, path="/ui")
|
| 87 |
|
| 88 |
|
| 89 |
+
@app.get("/")
|
| 90 |
+
def root():
|
| 91 |
+
return RedirectResponse(url="/ui")
|
| 92 |
+
|
| 93 |
+
|
| 94 |
if __name__ == "__main__":
|
| 95 |
uvicorn.run("app:app", host="0.0.0.0", port=int(os.getenv("PORT", "7860")))
|
env_server.py
CHANGED
|
@@ -197,7 +197,7 @@ class KernelOptimization_env:
|
|
| 197 |
env=KernelOptimization_env()
|
| 198 |
app=FastAPI(title="Kernel Optimization", version="1.0.0")
|
| 199 |
|
| 200 |
-
@app.get("/")
|
| 201 |
def health_check():
|
| 202 |
return {"status": "healthy", "service": "kernel-optimization-openenv"}
|
| 203 |
|
|
|
|
| 197 |
env=KernelOptimization_env()
|
| 198 |
app=FastAPI(title="Kernel Optimization", version="1.0.0")
|
| 199 |
|
| 200 |
+
@app.get("/health")
|
| 201 |
def health_check():
|
| 202 |
return {"status": "healthy", "service": "kernel-optimization-openenv"}
|
| 203 |
|