CosyVoice commited on
Commit
bcda6d8
1 Parent(s): 4d6a552

add prompt contraint

Browse files
Files changed (1) hide show
  1. cosyvoice/cli/frontend.py +1 -0
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: