Skip to content

Commit

Permalink
fix(norm): cannot compute fingerprint of empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 5, 2024
1 parent 1812f91 commit 6afc761
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChatTTS/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __call__(
self.logger.debug("split texts %s, tags %s", str(texts), str(tags))
texts = [self.normalizers[_lang](t) for t in texts]
self.logger.debug("normed texts %s", str(texts))
text = _combine_tags(texts, tags)
text = _combine_tags(texts, tags) if len(tags) > 0 else texts[0]
self.logger.debug("combined text %s", text)
if _lang == "zh":
text = self._apply_half2full_map(text)
Expand All @@ -196,7 +196,7 @@ def __call__(
self.logger.debug("split texts %s, tags %s", str(texts), str(tags))
texts = [self.reject_pattern.sub("", t) for t in texts]
self.logger.debug("normed texts %s", str(texts))
text = _combine_tags(texts, tags)
text = _combine_tags(texts, tags) if len(tags) > 0 else texts[0]
self.logger.debug("combined text %s", text)
return text

Expand Down

0 comments on commit 6afc761

Please sign in to comment.