File size: 750 Bytes
211e423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Main entry point for the KYB Tech Dots.OCR application.

Provides a callable ``main()`` for console_scripts and direct execution.
"""

import os
import uvicorn
from src.kybtech_dots_ocr.app import app


def main() -> None:
    """Start the FastAPI server with sensible defaults.

    This function is exposed as a console script via pyproject.toml.
    Set DOTS_OCR_SKIP_MODEL_LOAD=1 to skip heavy model download for local testing.
    """
    # Respect environment overrides for host/port
    host = os.getenv("HOST", "0.0.0.0")
    port = int(os.getenv("PORT", "7860"))
    log_level = os.getenv("LOG_LEVEL", "info")

    uvicorn.run(app, host=host, port=port, log_level=log_level)


if __name__ == "__main__":
    main()