Download vc/models/__init__.py from trandackhoa/TTS_stream: direct link, hf CLI and curl.
- Browser
- Download file 646 Bytes
-
https://huggingface.co/trandackhoa/TTS_stream/resolve/main/vc/models/__init__.py
- Command line
-
hf download hf://trandackhoa/TTS_stream/vc/models/__init__.py
-
curl -L -o __init__.py https://huggingface.co/trandackhoa/TTS_stream/resolve/main/vc/models/__init__.py
646 Bytes
| import importlib | |
| import logging | |
| import re | |
| from typing import Dict, List, Union | |
| logger = logging.getLogger(__name__) | |
| def to_camel(text): | |
| text = text.capitalize() | |
| return re.sub(r"(?!^)_([a-zA-Z])", lambda m: m.group(1).upper(), text) | |
| def setup_model(config: "Coqpit", samples: Union[List[List], List[Dict]] = None) -> "BaseVC": | |
| logger.info("Using model: %s", config.model) | |
| # fetch the right model implementation. | |
| if "model" in config and config["model"].lower() == "freevc": | |
| MyModel = importlib.import_module("TTS.vc.models.freevc").FreeVC | |
| model = MyModel.init_from_config(config, samples) | |
| return model | |