mirror of https://github.com/coqui-ai/TTS.git
fix spelling of a def argument and parse phonemes from config.json if
use_phonemes is Truepull/367/head
parent
1c1abb8a9b
commit
5f1018abee
|
@ -18,7 +18,7 @@ def create_argparser():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--list_models', type=convert_boolean, nargs='?', const=True, default=False, help='list available pre-trained tts and vocoder models.')
|
parser.add_argument('--list_models', type=convert_boolean, nargs='?', const=True, default=False, help='list available pre-trained tts and vocoder models.')
|
||||||
parser.add_argument('--model_name', type=str, default="tts_models/en/ljspeech/speedy-speech-wn", help='name of one of the released tts models.')
|
parser.add_argument('--model_name', type=str, default="tts_models/en/ljspeech/speedy-speech-wn", help='name of one of the released tts models.')
|
||||||
parser.add_argument('--vocoder_name', type=str, default="vocoder_models/en/ljspeech/mulitband-melgan", help='name of one of the released vocoder models.')
|
parser.add_argument('--vocoder_name', type=str, default="vocoder_models/en/ljspeech/multiband-melgan", help='name of one of the released vocoder models.')
|
||||||
parser.add_argument('--tts_checkpoint', type=str, help='path to custom tts checkpoint file')
|
parser.add_argument('--tts_checkpoint', type=str, help='path to custom tts checkpoint file')
|
||||||
parser.add_argument('--tts_config', type=str, help='path to custom tts config.json file')
|
parser.add_argument('--tts_config', type=str, help='path to custom tts config.json file')
|
||||||
parser.add_argument('--tts_speakers', type=str, help='path to JSON file containing speaker ids, if speaker ids are used in the model')
|
parser.add_argument('--tts_speakers', type=str, help='path to JSON file containing speaker ids, if speaker ids are used in the model')
|
||||||
|
|
|
@ -163,7 +163,7 @@ def check_config_tts(c):
|
||||||
check_argument('eos', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
check_argument('eos', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
||||||
check_argument('bos', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
check_argument('bos', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
||||||
check_argument('characters', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
check_argument('characters', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
||||||
check_argument('phonemes', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
check_argument('phonemes', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys() and c['use_phonemes'], val_type=str)
|
||||||
check_argument('punctuations', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
check_argument('punctuations', c['characters'] if 'characters' in c.keys() else {}, restricted='characters' in c.keys(), val_type=str)
|
||||||
|
|
||||||
# normalization parameters
|
# normalization parameters
|
||||||
|
|
|
@ -5,19 +5,20 @@ Defines the set of symbols used in text input to the model.
|
||||||
The default is a set of ASCII characters that works well for English or text that has been run
|
The default is a set of ASCII characters that works well for English or text that has been run
|
||||||
through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details.
|
through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details.
|
||||||
'''
|
'''
|
||||||
def make_symbols(characters, phonemes, punctuations='!\'(),-.:;? ', pad='_', eos='~', bos='^'):# pylint: disable=redefined-outer-name
|
def make_symbols(characters, phonemes=None, punctuations='!\'(),-.:;? ', pad='_', eos='~', bos='^'):# pylint: disable=redefined-outer-name
|
||||||
''' Function to create symbols and phonemes '''
|
''' Function to create symbols and phonemes '''
|
||||||
_phonemes_sorted = sorted(list(phonemes))
|
_symbols = [pad, eos, bos] + list(characters)
|
||||||
|
_phonemes = None
|
||||||
# Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the same as uppercase letters):
|
if phonemes is not None:
|
||||||
_arpabet = ['@' + s for s in _phonemes_sorted]
|
_phonemes_sorted = sorted(list(phonemes))
|
||||||
|
# Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the same as uppercase letters):
|
||||||
# Export all symbols:
|
_arpabet = ['@' + s for s in _phonemes_sorted]
|
||||||
_symbols = [pad, eos, bos] + list(characters) + _arpabet
|
# Export all symbols:
|
||||||
_phonemes = [pad, eos, bos] + list(_phonemes_sorted) + list(punctuations)
|
_phonemes = [pad, eos, bos] + list(_phonemes_sorted) + list(punctuations)
|
||||||
|
_symbols += _arpabet
|
||||||
return _symbols, _phonemes
|
return _symbols, _phonemes
|
||||||
|
|
||||||
|
|
||||||
_pad = '_'
|
_pad = '_'
|
||||||
_eos = '~'
|
_eos = '~'
|
||||||
_bos = '^'
|
_bos = '^'
|
||||||
|
|
Loading…
Reference in New Issue