Description
I was able to run the programmatic code normally before, but now it throws an error. Below are my running code and the error message:
code:
import dac
from audiotools import AudioSignal
import time
import torch
model_path = dac.utils.download(model_type="24khz")
start_time1=time.time()
model = dac.DAC.load(model_path)
model.to('cuda')
signal = AudioSignal('Encodec_sample.wav')
start_time = time.time()
signal.to(model.device)
x = model.preprocess(signal.audio_data, signal.sample_rate)
z, codes, latents, _, _ = model.encode(x)
end_time = time.time()
print(f"编码过程耗时: {end_time - start_time} 秒")
start_time = time.time()
y = model.decode(z)
end_time = time.time()
print(f"解码过程耗时: {end_time - start_time} 秒")
output_signal = AudioSignal(y.detach().cpu(), sample_rate=signal.sample_rate)
output_signal.write('output.wav')