Spaces:
Runtime error
Runtime error
Download tts/apps.py from TestandoIsso/Novo: direct link, hf CLI and curl.
- Browser
- Download file 710 Bytes
-
https://huggingface.co/spaces/TestandoIsso/Novo/resolve/main/tts/apps.py
- Command line
-
hf download hf://spaces/TestandoIsso/Novo/tts/apps.py
-
curl -L -o apps.py https://huggingface.co/spaces/TestandoIsso/Novo/resolve/main/tts/apps.py
710 Bytes
| from django.apps import AppConfig | |
| from rose_tts_hodc import TtsModelWrapper | |
| # import intel_extension_for_pytorch as ipex | |
| class TtsConfig(AppConfig): | |
| default_auto_field = 'django.db.models.BigAutoField' | |
| name = 'tts' | |
| models = {} | |
| def load_models(cls): | |
| for model_name in ['multispeaker', 'rose_perguntas']: | |
| model = cls.models.get(model_name) | |
| if model is None: | |
| model_path = 'models_ms/' + model_name + '.pth' | |
| model = TtsModelWrapper(model_path) | |
| # ipex.optimize(model.net_g, inplace=True) | |
| cls.models[model_name] = model | |
| def ready(self): | |
| TtsConfig.load_models() | |