@ -68,8 +68,20 @@ BARK_ENABLED = False
VERBOSE_DEBUG = True
KKS = None
PYKAKASI_ENABLED = False
import traceback
try :
import pykakasi
KKS = pykakasi . kakasi ( )
PYKAKASI_ENABLED = True
except Exception as e :
#if VERBOSE_DEBUG:
# print(traceback.format_exc())
pass
try :
from whisper . normalizers . english import EnglishTextNormalizer
from whisper . normalizers . basic import BasicTextNormalizer
@ -2734,6 +2746,14 @@ def prepare_dataset( voice, use_segments=False, text_length=0, audio_length=0, p
phn_file = jobs [ ' phonemize ' ] [ 0 ] [ i ]
normalized = jobs [ ' phonemize ' ] [ 1 ] [ i ]
if language == " japanese " :
language = " ja "
if language == " ja " and PYKAKASI_ENABLED and KKS is not None :
normalized = KKS . convert ( normalized )
normalized = [ n [ " hira " ] for n in normalized ]
normalized = " " . join ( normalized )
try :
phonemized = valle_phonemize ( normalized )
open ( phn_file , ' w ' , encoding = ' utf-8 ' ) . write ( " " . join ( phonemized ) )