refactor: remove duplicate to_camel

This commit is contained in:
Enno Hermann 2024-11-24 19:36:45 +01:00
parent 7330ad8854
commit 170d3dae92
2 changed files with 2 additions and 10 deletions

View File

@ -6,11 +6,6 @@ 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.

View File

@ -4,14 +4,11 @@ import re
from coqpit import Coqpit
from TTS.utils.generic_utils import to_camel
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):
"""Load models directly from configuration."""
if "discriminator_model" in config and "generator_model" in config: