Spaces:
Running
on
Zero
Running
on
Zero
add prompt contraint
Browse files
cosyvoice/cli/frontend.py
CHANGED
@@ -78,6 +78,7 @@ class CosyVoiceFrontEnd:
|
|
78 |
return text_token, text_token_len
|
79 |
|
80 |
def _extract_speech_token(self, speech):
|
|
|
81 |
feat = whisper.log_mel_spectrogram(speech, n_mels=128)
|
82 |
speech_token = self.speech_tokenizer_session.run(None,
|
83 |
{self.speech_tokenizer_session.get_inputs()[0].name:
|
|
|
78 |
return text_token, text_token_len
|
79 |
|
80 |
def _extract_speech_token(self, speech):
|
81 |
+
assert speech.shape[1] / 16000 <= 30, 'do not support extract speech token for audio longer than 30s'
|
82 |
feat = whisper.log_mel_spectrogram(speech, n_mels=128)
|
83 |
speech_token = self.speech_tokenizer_session.run(None,
|
84 |
{self.speech_tokenizer_session.get_inputs()[0].name:
|