MCPcopy
hub / github.com/2noise/ChatTTS / startup_event

Function startup_event

examples/api/main.py:36–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35@app.on_event("startup")
36async 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)

Callers

nothing calls this directly

Calls 5

loadMethod · 0.95
get_loggerFunction · 0.90
normalizer_en_nemo_textFunction · 0.90
normalizer_zh_tnFunction · 0.90
registerMethod · 0.80

Tested by

no test coverage detected