fix torch error and suggestion-mode

This commit is contained in:
doctorpangloss 2025-10-21 14:52:11 -07:00
parent 2261f18306
commit 170b8348a3
2 changed files with 4 additions and 4 deletions

View File

@ -106,14 +106,14 @@ source-roots=
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# In verbose mode, extra non-checker-related info will be displayed.
#verbose=
# verbose=
[BASIC]

View File

@ -143,13 +143,13 @@ class AudioAutoencoder(nn.Module):
mel_decoded = self.vae.decode(z)
audio = self.vocoder(mel_decoded)
import torchaudio
import torchaudio # pylint: disable=import-error, noqa: F401
audio = torchaudio.functional.resample(audio, 16000, 44100)
return audio
@torch.no_grad()
def encode(self, audio):
import torchaudio
import torchaudio # pylint: disable=import-error, noqa: F401
audio = audio.mean(dim=1)
audio = torchaudio.functional.resample(audio, 44100, 16000)
dist = self.encode_audio(audio)