Spaces:
Sleeping
Sleeping
ulysses115
commited on
Commit
•
3607437
1
Parent(s):
982af36
Update app.py
Browse files
app.py
CHANGED
@@ -44,15 +44,13 @@ def audio_postprocess(self, y):
|
|
44 |
|
45 |
gr.Audio.postprocess = audio_postprocess
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
text_norm = text_to_sequence(text, hps.symbols, [] if is_symbol else hps.data.text_cleaners)
|
50 |
if hps.data.add_blank:
|
51 |
text_norm = commons.intersperse(text_norm, 0)
|
52 |
-
text_norm = LongTensor(text_norm)
|
53 |
return text_norm
|
54 |
|
55 |
-
|
56 |
def create_tts_fn(model, hps, speaker_ids):
|
57 |
def tts_fn(text, speaker, speed, is_symbol):
|
58 |
if limitation:
|
@@ -124,10 +122,9 @@ if __name__ == '__main__':
|
|
124 |
cover_path = cover
|
125 |
hps = utils.get_hparams_from_file(config_path)
|
126 |
model = SynthesizerTrn(
|
127 |
-
len(
|
128 |
hps.data.filter_length // 2 + 1,
|
129 |
hps.train.segment_size // hps.data.hop_length,
|
130 |
-
n_speakers=hps.data.n_speakers,
|
131 |
**hps.model)
|
132 |
utils.load_checkpoint(model_path, model, None)
|
133 |
model.eval().to(device)
|
|
|
44 |
|
45 |
gr.Audio.postprocess = audio_postprocess
|
46 |
|
47 |
+
def get_text(text, hps):
|
48 |
+
text_norm = text_to_sequence(text, hps.data.text_cleaners)
|
|
|
49 |
if hps.data.add_blank:
|
50 |
text_norm = commons.intersperse(text_norm, 0)
|
51 |
+
text_norm = torch.LongTensor(text_norm)
|
52 |
return text_norm
|
53 |
|
|
|
54 |
def create_tts_fn(model, hps, speaker_ids):
|
55 |
def tts_fn(text, speaker, speed, is_symbol):
|
56 |
if limitation:
|
|
|
122 |
cover_path = cover
|
123 |
hps = utils.get_hparams_from_file(config_path)
|
124 |
model = SynthesizerTrn(
|
125 |
+
len(symbols),
|
126 |
hps.data.filter_length // 2 + 1,
|
127 |
hps.train.segment_size // hps.data.hop_length,
|
|
|
128 |
**hps.model)
|
129 |
utils.load_checkpoint(model_path, model, None)
|
130 |
model.eval().to(device)
|