Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- app/main.py +2 -2
app/main.py
CHANGED
|
@@ -7,7 +7,7 @@ from starlette.responses import FileResponse
|
|
| 7 |
import os
|
| 8 |
app = FastAPI()
|
| 9 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache' ## For Docker
|
| 10 |
-
app.mount("/files/", StaticFiles(directory='
|
| 11 |
class TextInput(BaseModel):
|
| 12 |
InputText: str # python casing??????
|
| 13 |
|
|
@@ -18,7 +18,7 @@ def emotion_detection(str1: str) -> str:
|
|
| 18 |
return expected[0].get('label')
|
| 19 |
@app.get("/")
|
| 20 |
async def read_index():
|
| 21 |
-
return FileResponse('index.html')
|
| 22 |
@app.post("/generate-emotion/")
|
| 23 |
async def detect_emotion(input_data: TextInput):
|
| 24 |
text1 = input_data.InputText
|
|
|
|
| 7 |
import os
|
| 8 |
app = FastAPI()
|
| 9 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache' ## For Docker
|
| 10 |
+
app.mount("/files/", StaticFiles(directory='../code'), name="index")
|
| 11 |
class TextInput(BaseModel):
|
| 12 |
InputText: str # python casing??????
|
| 13 |
|
|
|
|
| 18 |
return expected[0].get('label')
|
| 19 |
@app.get("/")
|
| 20 |
async def read_index():
|
| 21 |
+
return FileResponse('app/index.html')
|
| 22 |
@app.post("/generate-emotion/")
|
| 23 |
async def detect_emotion(input_data: TextInput):
|
| 24 |
text1 = input_data.InputText
|