ms180 commited on
Commit
0ba6132
·
1 Parent(s): 6d3b6c8

Fixed route issue

Browse files
Files changed (1) hide show
  1. 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, RedirectResponse
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 RedirectResponse(url="/demo", status_code=303)
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)