write output fix
This commit is contained in:
parent
a880125322
commit
687f67e40c
|
|
@ -84,10 +84,15 @@ class Inference:
|
||||||
|
|
||||||
if isinstance(filename,str):
|
if isinstance(filename,str):
|
||||||
filename = Path(filename)
|
filename = Path(filename)
|
||||||
|
|
||||||
|
parent, name = filename.parent, "cleaned_"+filename.name
|
||||||
|
filename = parent/Path(name)
|
||||||
if filename.is_file():
|
if filename.is_file():
|
||||||
raise FileExistsError(f"file {filename} already exists")
|
raise FileExistsError(f"file {filename} already exists")
|
||||||
else:
|
else:
|
||||||
wavfile.write(filename,rate=sr,data=waveform.detach().cpu())
|
if isinstance(waveform,torch.Tensor):
|
||||||
|
waveform = waveform.detach().cpu().squeeze().numpy()
|
||||||
|
wavfile.write(filename,rate=sr,data=waveform)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare_output(waveform:torch.Tensor, model_sampling_rate:int,
|
def prepare_output(waveform:torch.Tensor, model_sampling_rate:int,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue