File size: 1,761 Bytes
476d044
 
 
 
 
 
 
 
 
 
 
 
2b8c200
476d044
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
"""
Production Server Entry Point

Run with: python run.py
"""
import uvicorn
import argparse


def main():
    parser = argparse.ArgumentParser(description="AI Voice Detection API Server")
    parser.add_argument("--host", default="0.0.0.0", help="Host to bind to")
    parser.add_argument("--port", type=int, default=8001, help="Port to bind to")
    parser.add_argument("--reload", action="store_true", help="Enable auto-reload")
    parser.add_argument("--workers", type=int, default=1, help="Number of workers")
    
    args = parser.parse_args()
    
    print(f"""
╔══════════════════════════════════════════════════════════════╗
β•‘           AI Voice Detection API Server                      β•‘
╠══════════════════════════════════════════════════════════════╣
β•‘  πŸš€ Starting server...                                       β•‘
β•‘  πŸ“ URL: http://{args.host}:{args.port}                              β•‘
β•‘  πŸ“š Docs: http://{args.host}:{args.port}/docs                        β•‘
β•‘  πŸ” API: http://{args.host}:{args.port}/api/v1/detect                β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
    """)
    
    uvicorn.run(
        "app.main:app",
        host=args.host,
        port=args.port,
        reload=args.reload,
        workers=args.workers if not args.reload else 1
    )


if __name__ == "__main__":
    main()