Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- 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 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 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()
|