Skip to content

Commit

Permalink
fix: remove text limit in vits
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Apr 18, 2023
1 parent 3072da3 commit bd44d84
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions utils/vits_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,9 @@ def save_voice_file(self, content, save_path):
return save_path

def linguistic_process(self, text):
if len(text) > 150:
text = "这句话太长了,抱歉"

lang = self.lang

if lang == "auto":return text
if lang == "auto": return text

patterns = {
"mix": r'[\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\>\=\?\@\[\]\{\}\\\\\^\_\`\~\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b\u4e00-\u9fff]+|[\u3040-\u309f\u30a0-\u30ff]+|\w+|[^\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\w]+',
Expand Down Expand Up @@ -150,7 +147,8 @@ async def process_message(self, message, path):


vits_api_instance = VitsAPI()


async def vits_api(message: str, path: str):
await vits_api_instance.initialize()
return await vits_api_instance.process_message(message, path)

0 comments on commit bd44d84

Please sign in to comment.