diff --git a/pyproject.toml b/pyproject.toml index 1d059afe..85d79dbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "GPT-SoVITS-Infer" -version = "0.2.1" +version = "0.2.2" description = "Inference code for GPT-SoVITS" authors = [ {name = "Yanli",email = "mail@yanli.one"}, @@ -21,7 +21,7 @@ dependencies = [ "wordsegment>=1.3.1", "nltk>=3.8.1", ] -requires-python = ">=3.10" +requires-python = ">=3.10, <3.12" readme = "README.md" license = {text = "MIT"} diff --git a/src/gpt_sovits/infer/text_utils.py b/src/gpt_sovits/infer/text_utils.py index 36c3113a..db862068 100644 --- a/src/gpt_sovits/infer/text_utils.py +++ b/src/gpt_sovits/infer/text_utils.py @@ -39,7 +39,7 @@ def cut5(inp: str): return mergeitems -def merge_short_texts(texts: List[str], threshold: int = 6): +def merge_short_texts(texts: List[str], threshold: int = 32): """Merge short texts to longer ones. Texts are generated by cut5.""" result: List[str] = [] text = "" @@ -61,5 +61,5 @@ def clean_and_cut_text(text: str) -> List[str]: for merged in merge_short_texts(cut5(line)) if not all(char in splits for char in merged.strip()) ] - texts = ["." + text if len(text) < 5 else text for text in texts] + texts = [("." + text) if len(text) < 5 else text for text in texts] return texts