model = model.to(device) gives me problems

#6
by JackMack - opened

Sorry so noob, I been on this few hours:

This part of the code from model card is giving me hassles:

model = model.to(device)

AttributeError: 'dict' object has no attribute 'to'

Claude Opus tells me :
In the official documentation, the line model = model.to(device) assumes that model is a PyTorch model object, which has the to method to move the model to the specified device (CPU or GPU). However, in your case, the loaded checkpoint seems to contain a dictionary.
To resolve this issue, you need to extract the actual model object from the loaded dictionary. Based on the provided model configuration, it appears that the model is a conditional diffusion model.
Here's an updated version of the code that should work:

model.eval()
model = model.to(device)

model.eval()

AttributeError: 'dict' object has no attribute 'eval'

Remove the spaces and run on local using your hf_token
https://huggingface.co/spaces/ameerazam08/stableaudio-open-1.0

OK thank you, will try it out.

Sign up or log in to comment