Spaces:
Sleeping
Sleeping
primepake
commited on
Commit
·
3ba181f
1
Parent(s):
5d43438
update readme dac
Browse files- dac-vae/README.md +0 -28
dac-vae/README.md
CHANGED
|
@@ -69,34 +69,6 @@ python3 train.py --run_id factorx2
|
|
| 69 |
# Multi-GPU training (4 GPUs)
|
| 70 |
torchrun --nnodes=1 --nproc_per_node=4 train.py --run_id factorx2
|
| 71 |
```
|
| 72 |
-
|
| 73 |
-
### Python API
|
| 74 |
-
|
| 75 |
-
```python
|
| 76 |
-
import torch
|
| 77 |
-
from dac_vae import DACVAE
|
| 78 |
-
|
| 79 |
-
# Load model
|
| 80 |
-
model = DACVAE.load_from_checkpoint("checkpoint.pt")
|
| 81 |
-
model.eval()
|
| 82 |
-
|
| 83 |
-
# Load audio (assuming 24kHz)
|
| 84 |
-
audio, sr = torchaudio.load("input.wav")
|
| 85 |
-
if sr != 24000:
|
| 86 |
-
audio = torchaudio.functional.resample(audio, sr, 24000)
|
| 87 |
-
|
| 88 |
-
# Encode to latent
|
| 89 |
-
with torch.no_grad():
|
| 90 |
-
latent = model.encode(audio)
|
| 91 |
-
|
| 92 |
-
# Decode back to audio
|
| 93 |
-
with torch.no_grad():
|
| 94 |
-
reconstructed = model.decode(latent)
|
| 95 |
-
|
| 96 |
-
# Save output
|
| 97 |
-
torchaudio.save("output.wav", reconstructed, 24000)
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
## Model Architecture
|
| 101 |
|
| 102 |
DAC-VAE preserves most of the original DAC architecture with key modifications:
|
|
|
|
| 69 |
# Multi-GPU training (4 GPUs)
|
| 70 |
torchrun --nnodes=1 --nproc_per_node=4 train.py --run_id factorx2
|
| 71 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
## Model Architecture
|
| 73 |
|
| 74 |
DAC-VAE preserves most of the original DAC architecture with key modifications:
|