DataSage12 commited on
Commit
f3b41f5
·
verified ·
1 Parent(s): aa7de1a

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +5 -4
app/main.py CHANGED
@@ -4,7 +4,7 @@ from pydantic import BaseModel
4
  from transformers import pipeline
5
  from fastapi.staticfiles import StaticFiles
6
  import logging
7
-
8
 
9
 
10
 
@@ -51,9 +51,10 @@ class PredictOut(BaseModel):
51
  sentiment: str
52
  confidence: float
53
 
54
- @app.get("/")
55
- def health():
56
- return {"status": "ok"}
 
57
 
58
  def _normalize_label(label: str) -> str:
59
  l = (label or "").lower()
 
4
  from transformers import pipeline
5
  from fastapi.staticfiles import StaticFiles
6
  import logging
7
+ from fastapi.responses import FileResponse
8
 
9
 
10
 
 
51
  sentiment: str
52
  confidence: float
53
 
54
+
55
+ @app.get("/", include_in_schema=False)
56
+ def root():
57
+ return FileResponse(os.path.join("static", "index.html"))
58
 
59
  def _normalize_label(label: str) -> str:
60
  l = (label or "").lower()