레거시 모드

This commit is contained in:
kyy
2025-11-06 12:02:22 +09:00
parent 6a3b52fe7c
commit f757a541f8
2 changed files with 54 additions and 18 deletions

23
api.py
View File

@@ -1,7 +1,19 @@
import logging
from config.env_setup import setup_environment
# 환경 변수 설정을 최우선으로 호출
setup_environment()
# 로깅 기본 설정
logging.basicConfig(
level=logging.INFO, format="%(asctime)s [%(levelname)s] %(name)s - %(message)s"
)
logger = logging.getLogger("startup")
from fastapi import FastAPI
from router import deepseek_router
from services.ocr_engine import init_engine
logging.basicConfig(
level=logging.INFO, format="%(asctime)s [%(levelname)s] %(name)s - %(message)s"
@@ -14,6 +26,17 @@ app = FastAPI(
)
@app.on_event("startup")
async def startup_event():
"""FastAPI startup event handler."""
logging.info("Application startup...")
try:
await init_engine()
logging.info("vLLM engine initialized successfully.")
except Exception as e:
logging.error(f"vLLM engine init failed: {e}", exc_info=True)
@app.get("/health/API", include_in_schema=False)
async def health_check():
return {"status": "API ok"}