Commit 9b8e702f authored by Phil Wang's avatar Phil Wang
Browse files

allow researchers to easily use original audiolm soundstream config

parent 043dae08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
from audiolm_pytorch.audiolm_pytorch import AudioLM
from audiolm_pytorch.soundstream import SoundStream
from audiolm_pytorch.soundstream import SoundStream, AudioLMSoundStream, MusicLMSoundStream

from audiolm_pytorch.audiolm_pytorch import SemanticTransformer, CoarseTransformer, FineTransformer
from audiolm_pytorch.audiolm_pytorch import FineTransformerWrapper, CoarseTransformerWrapper, SemanticTransformerWrapper
+30 −0
Original line number Diff line number Diff line
@@ -708,3 +708,33 @@ class SoundStream(nn.Module):
            return total_loss, (recon_loss, multi_spectral_recon_loss, adversarial_loss, feature_loss, all_commitment_loss)

        return total_loss

# some default soundstreams

class AudioLMSoundStream(SoundStream):
    def __init__(
        self,
        strides = (2, 4, 5, 8),
        target_sample_hz = 16000,
        rq_num_quantizers = 8,
        **kwargs
    ):
        super().__init__(
            strides = strides,
            target_sample_hz = target_sample_hz,
            **kwargs
        )

class MusicLMSoundStream(SoundStream):
    def __init__(
        self,
        strides = (3, 4, 5, 8),
        target_sample_hz = 24000,
        rq_num_quantizers = 12,
        **kwargs
    ):
        super().__init__(
            strides = strides,
            target_sample_hz = target_sample_hz,
            **kwargs
        )
+1 −1
Original line number Diff line number Diff line
__version__ = '0.15.8'
__version__ = '0.15.9'