app.py 583 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. import os
  3. import uvicorn
  4. from digitalHuman.engine import EnginePool
  5. from digitalHuman.agent import AgentPool
  6. from digitalHuman.server import app
  7. from digitalHuman.utils import config
  8. __all__ = ["runServer"]
  9. def runServer():
  10. enginePool = EnginePool()
  11. enginePool.setup(config.SERVER.ENGINES)
  12. agentPool = AgentPool()
  13. agentPool.setup(config.SERVER.AGENTS)
  14. # 后端使用 HTTP 模式(前端使用 HTTPS)
  15. uvicorn.run(
  16. app,
  17. host=config.SERVER.IP,
  18. port=config.SERVER.PORT,
  19. log_level="info"
  20. )