Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions acestep/cpu_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __exit__(self, *args):
self.model.to("cpu")
if torch.cuda.is_available():
torch.cuda.empty_cache()
torch.cuda.synchronize()
# torch.cuda.synchronize()


T = TypeVar('T')
Expand All @@ -31,8 +31,8 @@ def wrapper(self, *args, **kwargs):
if not self.cpu_offload:
return func(self, *args, **kwargs)

# Get the device from the class
device = self.device
# Get the device from the class device map
device = getattr(self, "device_map", {}).get(model_attr, self.device)
# Get the model from the class attribute
model = getattr(self, model_attr)

Expand Down
1 change: 1 addition & 0 deletions acestep/music_dcae/music_dcae_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def decode(self, latents, audio_lengths=None, sr=None):
pred_wavs = []

for latent in latents:
latent = latent.to(self.device)
mels = self.dcae.decoder(latent.unsqueeze(0))
mels = mels * 0.5 + 0.5
mels = mels * (self.max_mel_value - self.min_mel_value) + self.min_mel_value
Expand Down
Loading