switch -> git+ url

This commit is contained in:
mrfakename
2025-05-06 20:19:51 -07:00
parent 38d62623fc
commit afa0332e8c
6 changed files with 16 additions and 14 deletions
+2 -2
View File
@@ -164,5 +164,5 @@ if __name__ == "__main__":
print("latents shape: ", latents.shape)
print("latent_lengths: ", latent_lengths)
print("sr: ", sr)
torchaudio.save("test_reconstructed.flac", pred_wavs[0], sr)
print("test_reconstructed.flac")
torchaudio.save("test_reconstructed.wav", pred_wavs[0], sr)
print("test_reconstructed.wav")
+2 -2
View File
@@ -574,7 +574,7 @@ class ADaMoSHiFiGANV1(ModelMixin, ConfigMixin, FromOriginalModelMixin):
if __name__ == "__main__":
import soundfile as sf
x = "test_audio.flac"
x = "test_audio.wav"
model = ADaMoSHiFiGANV1.from_pretrained(
"./checkpoints/music_vocoder", local_files_only=True
)
@@ -584,4 +584,4 @@ if __name__ == "__main__":
mel = model.encode(wav)
wav = model.decode(mel)[0].mT
sf.write("test_audio_vocoder_rec.flac", wav.cpu().numpy(), 44100)
sf.write("test_audio_vocoder_rec.wav", wav.cpu().numpy(), 44100)
+8 -7
View File
@@ -1326,7 +1326,7 @@ class ACEStepPipeline:
target_wav_duration_second=30,
sample_rate=48000,
save_path=None,
format="flac",
format="wav",
):
output_audio_paths = []
bs = latents.shape[0]
@@ -1343,7 +1343,7 @@ class ACEStepPipeline:
return output_audio_paths
def save_wav_file(
self, target_wav, idx, save_path=None, sample_rate=48000, format="flac"
self, target_wav, idx, save_path=None, sample_rate=48000, format="wav"
):
if save_path is None:
logger.warning("save_path is None, using default path ./outputs/")
@@ -1353,14 +1353,15 @@ class ACEStepPipeline:
base_path = save_path
ensure_directory_exists(base_path)
output_path_flac = (
f"{base_path}/output_{time.strftime('%Y%m%d%H%M%S')}_{idx}.{format}"
output_path_wav = (
f"{base_path}/output_{time.strftime('%Y%m%d%H%M%S')}_{idx}.wav"
)
target_wav = target_wav.float()
print(target_wav)
torchaudio.save(
output_path_flac, target_wav, sample_rate=sample_rate, format=format
output_path_wav, target_wav, sample_rate=sample_rate, format=format
)
return output_path_flac
return output_path_wav
def infer_latents(self, input_audio_path):
if input_audio_path is None:
@@ -1404,7 +1405,7 @@ class ACEStepPipeline:
edit_n_max: float = 1.0,
edit_n_avg: int = 1,
save_path: str = None,
format: str = "flac",
format: str = "wav",
batch_size: int = 1,
debug: bool = False,
):