int4 weight only quantized model using torchao

This commit is contained in:
xushengyuan
2025-05-09 20:27:25 +08:00
parent 3f1813d0d5
commit 054f599ebd
4 changed files with 288 additions and 37 deletions
+1 -3
View File
@@ -124,10 +124,8 @@ class MusicDCAE(ModelMixin, ConfigMixin, FromOriginalModelMixin):
if sr is not None:
resampler = (
torchaudio.transforms.Resample(44100, sr)
.to(latents.device)
.to(latents.dtype)
)
wav = resampler(wav)
wav = resampler(wav.cpu().float()).to(latent.device).to(latent.dtype)
else:
sr = 44100
pred_wavs.append(wav)