diff --git a/stable_audio_tools/inference/generation.py b/stable_audio_tools/inference/generation.py index 6be95d51..9de8c2ce 100644 --- a/stable_audio_tools/inference/generation.py +++ b/stable_audio_tools/inference/generation.py @@ -195,7 +195,7 @@ def generate_diffusion_cond( # Seed # The user can explicitly set the seed to deterministically generate the same output. Otherwise, use a random seed. - seed = seed if seed != -1 else np.random.randint(0, 2**32 - 1) + seed = seed if seed != -1 else np.random.randint(0, 2**32 - 1, dtype=np.uint32) torch.manual_seed(seed) # Define the initial noise immediately after setting the seed noise = torch.randn([batch_size, model.io_channels, latent_sample_size], device=device) @@ -465,7 +465,7 @@ def generate_diffusion_cond_inpaint( # Seed # The user can explicitly set the seed to deterministically generate the same output. Otherwise, use a random seed. - seed = seed if seed != -1 else np.random.randint(0, 2**32 - 1) + seed = seed if seed != -1 else np.random.randint(0, 2**32 - 1, dtype=np.uint32) torch.manual_seed(seed) # Define the initial noise immediately after setting the seed noise = torch.randn([batch_size, model.io_channels, sample_size], device=device)