Spaces:
Paused
Paused
Update inference/m4singer/base_svs_infer.py
Browse files
inference/m4singer/base_svs_infer.py
CHANGED
|
@@ -40,11 +40,11 @@ class BaseSVSInfer:
|
|
| 40 |
self.vocoder.eval()
|
| 41 |
self.vocoder.to(self.device)
|
| 42 |
|
| 43 |
-
@spaces.GPU(duration=
|
| 44 |
def build_model(self):
|
| 45 |
raise NotImplementedError
|
| 46 |
|
| 47 |
-
@spaces.GPU(duration=
|
| 48 |
def forward_model(self, inp):
|
| 49 |
raise NotImplementedError
|
| 50 |
|
|
@@ -74,7 +74,7 @@ class BaseSVSInfer:
|
|
| 74 |
# [T]
|
| 75 |
return y[None]
|
| 76 |
|
| 77 |
-
@spaces.GPU(duration=
|
| 78 |
def preprocess_word_level_input(self, inp):
|
| 79 |
# Pypinyin can't solve polyphonic words
|
| 80 |
text_raw = inp['text'].replace('最长', '最常').replace('长睫毛', '常睫毛') \
|
|
@@ -144,7 +144,7 @@ class BaseSVSInfer:
|
|
| 144 |
return None
|
| 145 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
| 146 |
|
| 147 |
-
@spaces.GPU(duration=
|
| 148 |
def preprocess_phoneme_level_input(self, inp):
|
| 149 |
ph_seq = inp['ph_seq']
|
| 150 |
note_lst = inp['note_seq'].split()
|
|
@@ -159,7 +159,7 @@ class BaseSVSInfer:
|
|
| 159 |
return None
|
| 160 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
| 161 |
|
| 162 |
-
@spaces.GPU(duration=
|
| 163 |
def preprocess_input(self, inp, input_type='word'):
|
| 164 |
"""
|
| 165 |
:param inp: {'text': str, 'item_name': (str, optional), 'spk_name': (str, optional)}
|
|
@@ -229,7 +229,7 @@ class BaseSVSInfer:
|
|
| 229 |
}
|
| 230 |
return batch
|
| 231 |
|
| 232 |
-
@spaces.GPU(duration=
|
| 233 |
def postprocess_output(self, output):
|
| 234 |
return output
|
| 235 |
|
|
|
|
| 40 |
self.vocoder.eval()
|
| 41 |
self.vocoder.to(self.device)
|
| 42 |
|
| 43 |
+
@spaces.GPU(duration=6)
|
| 44 |
def build_model(self):
|
| 45 |
raise NotImplementedError
|
| 46 |
|
| 47 |
+
@spaces.GPU(duration=6)
|
| 48 |
def forward_model(self, inp):
|
| 49 |
raise NotImplementedError
|
| 50 |
|
|
|
|
| 74 |
# [T]
|
| 75 |
return y[None]
|
| 76 |
|
| 77 |
+
@spaces.GPU(duration=6)
|
| 78 |
def preprocess_word_level_input(self, inp):
|
| 79 |
# Pypinyin can't solve polyphonic words
|
| 80 |
text_raw = inp['text'].replace('最长', '最常').replace('长睫毛', '常睫毛') \
|
|
|
|
| 144 |
return None
|
| 145 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
| 146 |
|
| 147 |
+
@spaces.GPU(duration=6)
|
| 148 |
def preprocess_phoneme_level_input(self, inp):
|
| 149 |
ph_seq = inp['ph_seq']
|
| 150 |
note_lst = inp['note_seq'].split()
|
|
|
|
| 159 |
return None
|
| 160 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
| 161 |
|
| 162 |
+
@spaces.GPU(duration=6)
|
| 163 |
def preprocess_input(self, inp, input_type='word'):
|
| 164 |
"""
|
| 165 |
:param inp: {'text': str, 'item_name': (str, optional), 'spk_name': (str, optional)}
|
|
|
|
| 229 |
}
|
| 230 |
return batch
|
| 231 |
|
| 232 |
+
@spaces.GPU(duration=6)
|
| 233 |
def postprocess_output(self, output):
|
| 234 |
return output
|
| 235 |
|