mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 14:20:49 +08:00
fix torch error and suggestion-mode
This commit is contained in:
parent
2261f18306
commit
170b8348a3
@ -106,14 +106,14 @@ source-roots=
|
|||||||
|
|
||||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||||
# user-friendly hints instead of false-positive error messages.
|
# 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
|
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||||
# active Python interpreter and may run arbitrary code.
|
# active Python interpreter and may run arbitrary code.
|
||||||
unsafe-load-any-extension=no
|
unsafe-load-any-extension=no
|
||||||
|
|
||||||
# In verbose mode, extra non-checker-related info will be displayed.
|
# In verbose mode, extra non-checker-related info will be displayed.
|
||||||
#verbose=
|
# verbose=
|
||||||
|
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
|
|||||||
@ -143,13 +143,13 @@ class AudioAutoencoder(nn.Module):
|
|||||||
mel_decoded = self.vae.decode(z)
|
mel_decoded = self.vae.decode(z)
|
||||||
audio = self.vocoder(mel_decoded)
|
audio = self.vocoder(mel_decoded)
|
||||||
|
|
||||||
import torchaudio
|
import torchaudio # pylint: disable=import-error, noqa: F401
|
||||||
audio = torchaudio.functional.resample(audio, 16000, 44100)
|
audio = torchaudio.functional.resample(audio, 16000, 44100)
|
||||||
return audio
|
return audio
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
def encode(self, audio):
|
def encode(self, audio):
|
||||||
import torchaudio
|
import torchaudio # pylint: disable=import-error, noqa: F401
|
||||||
audio = audio.mean(dim=1)
|
audio = audio.mean(dim=1)
|
||||||
audio = torchaudio.functional.resample(audio, 44100, 16000)
|
audio = torchaudio.functional.resample(audio, 44100, 16000)
|
||||||
dist = self.encode_audio(audio)
|
dist = self.encode_audio(audio)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user