()
| 34 | |
| 35 | @app.on_event("startup") |
| 36 | async def startup_event(): |
| 37 | global chat |
| 38 | |
| 39 | chat = ChatTTS.Chat(get_logger("ChatTTS")) |
| 40 | chat.normalizer.register("en", normalizer_en_nemo_text()) |
| 41 | chat.normalizer.register("zh", normalizer_zh_tn()) |
| 42 | |
| 43 | logger.info("Initializing ChatTTS...") |
| 44 | if chat.load(source="huggingface"): |
| 45 | logger.info("Models loaded successfully.") |
| 46 | else: |
| 47 | logger.error("Models load failed.") |
| 48 | sys.exit(1) |
| 49 | |
| 50 | |
| 51 | @app.exception_handler(RequestValidationError) |
nothing calls this directly
no test coverage detected