Open rsxdalv opened 1 year ago
been playing since the release and never felt that setting a torch generator did anything, i changed a few lines to be able to call the generator from generate() and now i can set the seed on each generation by passing a torch.Generator(device='cuda').manual_seed(seed)
.
just had to edit a few lines on musicgen.py and lm.py
https://github.com/hypereikon/audiocraft/tree/main/audiocraft/models
@hypereikon Thank you, I tried it but it still acts essentially the same as the seeded version.
You can see the waveforms here:
And these are the generation params:
{
_audiocraft_version: "0.0.2a2",
prompt: "very slow piano",
text: "very slow piano",
melody: null,
model: "small",
duration: 10,
topk: 250,
topp: 0,
temperature: 1,
cfg_coef: 3,
seed: "123"
}
This is essentially the same result I got before, where the first ~2.5 seconds are stable but after that it diverges on every generation.
pypi audiocraft 0.0.1 can easily generate deterministic results when setting the pytorch seed. the current repo version c9179f8 (audiocraft-0.0.2a2) cannot do it anymore. After about 3-4 seconds the results suddenly bug out and become non-deterministic. I checked the torch.initial_seed() and it remains intact, and I wasn't immediately able to see a problem with the new changes since 0.0.1.
Maybe someone can point it out?