Spaces:
Running
Running
Update InferenceInterfaces/Meta_FastSpeech2.py
Browse files
InferenceInterfaces/Meta_FastSpeech2.py
CHANGED
@@ -33,11 +33,16 @@ class Meta_FastSpeech2(torch.nn.Module):
|
|
33 |
wave, sr = soundfile.read(path_to_reference_audio)
|
34 |
self.default_utterance_embedding = ProsodicConditionExtractor(sr=sr).extract_condition_from_reference_wave(wave).to(self.device)
|
35 |
|
36 |
-
def
|
37 |
"""
|
38 |
The id parameter actually refers to the shorthand. This has become ambiguous with the introduction of the actual language IDs
|
39 |
"""
|
40 |
self.text2phone = ArticulatoryCombinedTextFrontend(language=lang_id, add_silence_to_end=True, silent=False)
|
|
|
|
|
|
|
|
|
|
|
41 |
self.lang_id = get_language_id(lang_id).to(self.device)
|
42 |
|
43 |
def forward(self, text, view=False, durations=None, pitch=None, energy=None):
|
|
|
33 |
wave, sr = soundfile.read(path_to_reference_audio)
|
34 |
self.default_utterance_embedding = ProsodicConditionExtractor(sr=sr).extract_condition_from_reference_wave(wave).to(self.device)
|
35 |
|
36 |
+
def set_phonemizer_language(self, lang_id):
|
37 |
"""
|
38 |
The id parameter actually refers to the shorthand. This has become ambiguous with the introduction of the actual language IDs
|
39 |
"""
|
40 |
self.text2phone = ArticulatoryCombinedTextFrontend(language=lang_id, add_silence_to_end=True, silent=False)
|
41 |
+
|
42 |
+
def set_accent_language(self, lang_id):
|
43 |
+
"""
|
44 |
+
The id parameter actually refers to the shorthand. This has become ambiguous with the introduction of the actual language IDs
|
45 |
+
"""
|
46 |
self.lang_id = get_language_id(lang_id).to(self.device)
|
47 |
|
48 |
def forward(self, text, view=False, durations=None, pitch=None, energy=None):
|