From de7ee7c7c15a2ec137feb0693b4ff3db61fad758 Mon Sep 17 00:00:00 2001 From: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:51:18 +0800 Subject: [PATCH] support gpt sovits v2 support gpt sovits v2 --- GPT_SoVITS/text/english.py | 5 ++++- GPT_SoVITS/text/japanese.py | 6 +++++- GPT_SoVITS/text/korean.py | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/GPT_SoVITS/text/english.py b/GPT_SoVITS/text/english.py index 6c80aea..d264925 100644 --- a/GPT_SoVITS/text/english.py +++ b/GPT_SoVITS/text/english.py @@ -6,7 +6,10 @@ from g2p_en import G2p from text.symbols import punctuation -from text import symbols +if os.environ.get("version","v1")=="v1": + from text.symbols import symbols +else: + from text.symbols2 import symbols import unicodedata from builtins import str as unicode diff --git a/GPT_SoVITS/text/japanese.py b/GPT_SoVITS/text/japanese.py index 5aa6a8f..3052187 100644 --- a/GPT_SoVITS/text/japanese.py +++ b/GPT_SoVITS/text/japanese.py @@ -5,7 +5,11 @@ import sys import pyopenjtalk -from text import symbols +import os +if os.environ.get("version","v1")=="v1": + from text.symbols import symbols +else: + from text.symbols2 import symbols from text.symbols import punctuation # Regular expression matching Japanese without punctuation marks: _japanese_characters = re.compile( diff --git a/GPT_SoVITS/text/korean.py b/GPT_SoVITS/text/korean.py index 6a4067e..a783305 100644 --- a/GPT_SoVITS/text/korean.py +++ b/GPT_SoVITS/text/korean.py @@ -2,7 +2,11 @@ import re from jamo import h2j, j2hcj import ko_pron from g2pk2 import G2p -from text import symbols +import os +if os.environ.get("version","v1")=="v1": + from text.symbols import symbols +else: + from text.symbols2 import symbols # This is a list of Korean classifiers preceded by pure Korean numerals. _korean_classifiers = '군데 권 개 그루 닢 대 두 마리 모 모금 뭇 발 발짝 방 번 벌 보루 살 수 술 시 쌈 움큼 정 짝 채 척 첩 축 켤레 톨 통'