Fix for parler-tts, do not add the last slice of padding tokens. (#2442)

* Fix for parler-tts, do not add the last slice of padding tokens.

* Support for the mini model.
This commit is contained in:
Laurent Mazare
2024-08-22 22:22:03 +01:00
committed by GitHub
parent e3c146ada6
commit 2ec8729d51
2 changed files with 21 additions and 3 deletions

View File

@ -429,7 +429,6 @@ impl Model {
let min_len = all_audio_tokens.iter().map(|v| v.len()).min().unwrap_or(0);
all_audio_tokens.iter_mut().for_each(|v| {
v.resize(min_len, 0);
v.push(self.pad_token_id)
});
let all_audio_tokens = Tensor::new(all_audio_tokens, &candle::Device::Cpu)?;
Ok(all_audio_tokens)