File size: 904 Bytes
cc06ed6
 
 
 
 
6cbca40
 
 
cc06ed6
6cbca40
 
cc06ed6
6cbca40
cc06ed6
6cbca40
 
cc06ed6
 
 
 
 
 
 
 
 
 
 
6cbca40
cc06ed6
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""

English Tutor API - Main Application

Optimized with Whisper model preloading for faster pronunciation assessment

"""

from dotenv import load_dotenv

load_dotenv()

from src.apis.create_app import create_app, api_router
import uvicorn
from loguru import logger

# Create FastAPI app with Whisper preloading
app = create_app()
app.include_router(api_router)

# Add root endpoint
@app.get("/")
async def root():
    return {
        "message": "πŸŽ“ English Tutor API with Optimized Whisper", 
        "status": "ready",
        "docs": "/docs",
        "health": "/health"
    }

if __name__ == "__main__":
    logger.info("πŸš€ Starting English Tutor API server...")
    uvicorn.run(
        "app:app", 
        host="0.0.0.0", 
        port=8000, 
        reload=False,  # Set to False to avoid reloading and losing preloaded model
        log_level="info"
    )