Spaces:
Sleeping
Sleeping
Fixed route issue
Browse files- modules/app.py +2 -3
modules/app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
from fastapi import APIRouter, FastAPI, Form, UploadFile
|
2 |
-
from fastapi.responses import FileResponse, JSONResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
|
5 |
from modules.asr_frontend import ASRModel, audio_from_file
|
@@ -12,7 +12,7 @@ asr_model = ASRModel()
|
|
12 |
|
13 |
@router.get("/")
|
14 |
async def index() -> FileResponse:
|
15 |
-
return
|
16 |
|
17 |
|
18 |
@router.get("/api/tts/load_model")
|
@@ -54,6 +54,5 @@ async def recognize(audio: UploadFile = Form(...)):
|
|
54 |
|
55 |
app = FastAPI()
|
56 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
57 |
-
app.mount("/demo", StaticFiles(directory="template", html=True), name="html")
|
58 |
|
59 |
app.include_router(router)
|
|
|
1 |
from fastapi import APIRouter, FastAPI, Form, UploadFile
|
2 |
+
from fastapi.responses import FileResponse, JSONResponse
|
3 |
from fastapi.staticfiles import StaticFiles
|
4 |
|
5 |
from modules.asr_frontend import ASRModel, audio_from_file
|
|
|
12 |
|
13 |
@router.get("/")
|
14 |
async def index() -> FileResponse:
|
15 |
+
return FileResponse(path="template/index.html", media_type="text/html")
|
16 |
|
17 |
|
18 |
@router.get("/api/tts/load_model")
|
|
|
54 |
|
55 |
app = FastAPI()
|
56 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
|
|
57 |
|
58 |
app.include_router(router)
|