Spaces:
Runtime error
Runtime error
Commit
·
38493c8
1
Parent(s):
df9828e
Update main.py
Browse files
main.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from fastapi.openapi.docs import get_swagger_ui_html
|
2 |
from fastapi import FastAPI
|
3 |
from pydantic import BaseModel
|
@@ -27,15 +28,20 @@ class PatientData(BaseModel):
|
|
27 |
Age: float
|
28 |
Insurance: int
|
29 |
|
30 |
-
@app.get("/")
|
31 |
-
def read_root():
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
39 |
#swagger ui
|
40 |
@app.get("/docs")
|
41 |
async def get_swagger_ui_html():
|
|
|
1 |
+
from fastapi import FastAPI, Request, HTTPException, APIRouter, Depends
|
2 |
from fastapi.openapi.docs import get_swagger_ui_html
|
3 |
from fastapi import FastAPI
|
4 |
from pydantic import BaseModel
|
|
|
28 |
Age: float
|
29 |
Insurance: int
|
30 |
|
31 |
+
# @app.get("/")
|
32 |
+
# def read_root():
|
33 |
+
# explanation = {
|
34 |
+
# 'message': "Welcome to the Sepsis Prediction App",
|
35 |
+
# 'description': "This API allows you to predict sepsis based on patient data.",
|
36 |
+
# 'usage': "Submit a POST request to /predict with patient data to make predictions.",
|
37 |
|
38 |
+
# }
|
39 |
+
# return explanation
|
40 |
+
|
41 |
+
@app.get("/")
|
42 |
+
async def root():
|
43 |
+
return RedirectResponse(url="/docs")
|
44 |
+
|
45 |
#swagger ui
|
46 |
@app.get("/docs")
|
47 |
async def get_swagger_ui_html():
|