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
|
44 |
def build_model(self):
|
45 |
raise NotImplementedError
|
46 |
|
47 |
-
@spaces.GPU
|
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
|
78 |
def preprocess_word_level_input(self, inp):
|
79 |
# Pypinyin can't solve polyphonic words
|
80 |
text_raw = inp['text']
|
@@ -142,7 +142,7 @@ class BaseSVSInfer:
|
|
142 |
return None
|
143 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
144 |
|
145 |
-
@spaces.GPU
|
146 |
def preprocess_phoneme_level_input(self, inp):
|
147 |
ph_seq = inp['ph_seq']
|
148 |
note_lst = inp['note_seq'].split()
|
@@ -157,7 +157,7 @@ class BaseSVSInfer:
|
|
157 |
return None
|
158 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
159 |
|
160 |
-
@spaces.GPU
|
161 |
def preprocess_input(self, inp, input_type='word'):
|
162 |
"""
|
163 |
:param inp: {'text': str, 'item_name': (str, optional), 'spk_name': (str, optional)}
|
@@ -227,7 +227,7 @@ class BaseSVSInfer:
|
|
227 |
}
|
228 |
return batch
|
229 |
|
230 |
-
@spaces.GPU
|
231 |
def postprocess_output(self, output):
|
232 |
return output
|
233 |
|
|
|
40 |
self.vocoder.eval()
|
41 |
self.vocoder.to(self.device)
|
42 |
|
43 |
+
@spaces.GPU(duration=8)
|
44 |
def build_model(self):
|
45 |
raise NotImplementedError
|
46 |
|
47 |
+
@spaces.GPU(duration=8)
|
48 |
def forward_model(self, inp):
|
49 |
raise NotImplementedError
|
50 |
|
|
|
74 |
# [T]
|
75 |
return y[None]
|
76 |
|
77 |
+
@spaces.GPU(duration=8)
|
78 |
def preprocess_word_level_input(self, inp):
|
79 |
# Pypinyin can't solve polyphonic words
|
80 |
text_raw = inp['text']
|
|
|
142 |
return None
|
143 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
144 |
|
145 |
+
@spaces.GPU(duration=8)
|
146 |
def preprocess_phoneme_level_input(self, inp):
|
147 |
ph_seq = inp['ph_seq']
|
148 |
note_lst = inp['note_seq'].split()
|
|
|
157 |
return None
|
158 |
return ph_seq, note_lst, midi_dur_lst, is_slur
|
159 |
|
160 |
+
@spaces.GPU(duration=8)
|
161 |
def preprocess_input(self, inp, input_type='word'):
|
162 |
"""
|
163 |
:param inp: {'text': str, 'item_name': (str, optional), 'spk_name': (str, optional)}
|
|
|
227 |
}
|
228 |
return batch
|
229 |
|
230 |
+
@spaces.GPU(duration=8)
|
231 |
def postprocess_output(self, output):
|
232 |
return output
|
233 |
|