update
Browse files- app.py +2 -1
- requirements.txt +0 -1
app.py
CHANGED
|
@@ -13,6 +13,7 @@ import numpy as np
|
|
| 13 |
import json
|
| 14 |
from datetime import datetime
|
| 15 |
import gc
|
|
|
|
| 16 |
|
| 17 |
from resonate.eval_utils import generate_fm, setup_eval_logging
|
| 18 |
from resonate.model.flow_matching import FlowMatching
|
|
@@ -187,7 +188,7 @@ def generate_audio_gradio(
|
|
| 187 |
filename = f"{safe_prompt}_{current_time_string}_{i}.flac"
|
| 188 |
save_path = OUTPUT_DIR / filename
|
| 189 |
# torchaudio.save(str(save_path), audio, seq_cfg.sampling_rate)
|
| 190 |
-
|
| 191 |
log.info(f"Audio saved to {save_path}")
|
| 192 |
save_paths.append(str(save_path))
|
| 193 |
|
|
|
|
| 13 |
import json
|
| 14 |
from datetime import datetime
|
| 15 |
import gc
|
| 16 |
+
import soundfile as sf
|
| 17 |
|
| 18 |
from resonate.eval_utils import generate_fm, setup_eval_logging
|
| 19 |
from resonate.model.flow_matching import FlowMatching
|
|
|
|
| 188 |
filename = f"{safe_prompt}_{current_time_string}_{i}.flac"
|
| 189 |
save_path = OUTPUT_DIR / filename
|
| 190 |
# torchaudio.save(str(save_path), audio, seq_cfg.sampling_rate)
|
| 191 |
+
sf.write(str(save_path), audio.squeeze().cpu().numpy(), seq_cfg.sampling_rate)
|
| 192 |
log.info(f"Audio saved to {save_path}")
|
| 193 |
save_paths.append(str(save_path))
|
| 194 |
|
requirements.txt
CHANGED
|
@@ -27,7 +27,6 @@ python-dotenv
|
|
| 27 |
transformers
|
| 28 |
debugpy
|
| 29 |
soundfile
|
| 30 |
-
torchcodec
|
| 31 |
|
| 32 |
--extra-index-url https://download.pytorch.org/whl/nightly/cu128
|
| 33 |
torchcodec
|
|
|
|
| 27 |
transformers
|
| 28 |
debugpy
|
| 29 |
soundfile
|
|
|
|
| 30 |
|
| 31 |
--extra-index-url https://download.pytorch.org/whl/nightly/cu128
|
| 32 |
torchcodec
|