加速错题 OCR:上传压缩、识别缩放、启动预热与 MKL-DNN。
This commit is contained in:
@@ -9,6 +9,7 @@ from fastapi.staticfiles import StaticFiles
|
||||
from app.core.config import settings
|
||||
from app.core.database import Base, SessionLocal, engine
|
||||
from app.routers import admin, auth, exams, export, settings as settings_router, students, subjects, wrong_questions
|
||||
from app.services import ocr as ocr_service
|
||||
from app.services.migrate import run_migrations
|
||||
from app.services.seed import seed_admin_and_settings, seed_subjects
|
||||
|
||||
@@ -34,6 +35,7 @@ async def lifespan(app: FastAPI):
|
||||
seed_admin_and_settings(db)
|
||||
finally:
|
||||
db.close()
|
||||
ocr_service.warmup_ocr_engine()
|
||||
yield
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user