Skip to content

Commit

Permalink
add prompt contraint
Browse files Browse the repository at this point in the history
  • Loading branch information
aluminumbox committed Sep 5, 2024
1 parent 4d6a552 commit bcda6d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cosyvoice/cli/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def _extract_text_token(self, text):
return text_token, text_token_len

def _extract_speech_token(self, speech):
assert speech.shape[1] / 16000 <= 30, 'do not support extract speech token for audio longer than 30s'
feat = whisper.log_mel_spectrogram(speech, n_mels=128)
speech_token = self.speech_tokenizer_session.run(None,
{self.speech_tokenizer_session.get_inputs()[0].name:
Expand Down

0 comments on commit bcda6d8

Please sign in to comment.