eaedk commited on
Commit
2f6028b
1 Parent(s): 81b6b88

request type specified

Browse files
Files changed (1) hide show
  1. main.py +10 -8
main.py CHANGED
@@ -1,15 +1,17 @@
1
- from fastapi import FastAPI
 
 
 
 
 
2
  from fastapi.responses import HTMLResponse
3
  from fastapi.staticfiles import StaticFiles
4
  from fastapi.templating import Jinja2Templates
5
- import uvicorn
6
  from typing import List, Literal, Optional
7
  from pydantic import BaseModel
8
  import pandas as pd
9
- import pickle
10
- import os
11
- import json
12
- import logging
13
 
14
  # logger
15
  logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG)
@@ -131,8 +133,8 @@ labels = ml_objects["labels"]
131
 
132
  # Root endpoint to serve index.html template
133
  @app.get("/", response_class=HTMLResponse)
134
- def root(request):
135
- return templates.TemplateResponse("index.html", {"request": request})
136
 
137
 
138
  @app.get("/checkup")
 
1
+ import uvicorn
2
+ import pickle
3
+ import os
4
+ import json
5
+ import logging
6
+ from fastapi import FastAPI, Request
7
  from fastapi.responses import HTMLResponse
8
  from fastapi.staticfiles import StaticFiles
9
  from fastapi.templating import Jinja2Templates
10
+
11
  from typing import List, Literal, Optional
12
  from pydantic import BaseModel
13
  import pandas as pd
14
+
 
 
 
15
 
16
  # logger
17
  logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG)
 
133
 
134
  # Root endpoint to serve index.html template
135
  @app.get("/", response_class=HTMLResponse)
136
+ async def root(request: Request):
137
+ return templates.TemplateResponse("index.html", {'request': request})
138
 
139
 
140
  @app.get("/checkup")