Add the SNAC audio tokenizer. (#2869)

* Add the SNAC audio tokenizer.

* More snac.

* Again more snac.

* Add some example code for snac.

* Get the weights to load.

* Add to the snac model.

* Fixes.

* Get round-tripping to work.

* Save/load code files.

* Clippy fix.

* Fmt fix.
This commit is contained in:
Laurent Mazare
2025-04-06 22:15:36 +02:00
committed by GitHub
parent 338f6a102e
commit e3370c6316
7 changed files with 1265 additions and 0 deletions

View File

@ -330,6 +330,7 @@ impl ResidualVectorQuantizer {
Ok(Self { quantizers })
}
#[allow(clippy::wrong_self_convention)]
pub fn from_codes(&self, codes: &Tensor) -> Result<Tensor> {
let mut sum = None;
for (idx, quantizer) in self.quantizers.iter().enumerate() {