Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stable_audio_tools/inference/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down