CoolFace
Apppublic

lenML/ChatTTS-Forge

sourceHugging Faceagpl-3.0updated 2y agoView on Hugging Face
301likes
models_api.py19 linesDownload Raw Back to impl
1from modules.api import utils as api_utils2from modules.api.Api import APIManager3from modules.Enhancer.ResembleEnhance import reload_enhancer, unload_enhancer4from modules.models import reload_chat_tts, unload_chat_tts5 6 7def setup(app: APIManager):8    @app.get("/v1/models/reload", response_model=api_utils.BaseResponse)9    async def reload_models():10        reload_chat_tts()11        reload_enhancer()12        return api_utils.success_response("Models reloaded")13 14    @app.get("/v1/models/unload", response_model=api_utils.BaseResponse)15    async def reload_models():16        unload_chat_tts()17        unload_enhancer()18        return api_utils.success_response("Models unloaded")19