Text-to-Speech
Transformers
Safetensors
audiodit
feature-extraction
audio
tts
environmental-tts
flow-matching
dit
custom_code
Instructions to use humanify/LongCat-AudioDiT-Env-TTS-1B-augment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use humanify/LongCat-AudioDiT-Env-TTS-1B-augment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="humanify/LongCat-AudioDiT-Env-TTS-1B-augment", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("humanify/LongCat-AudioDiT-Env-TTS-1B-augment", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Accurate model card (augment run: 1 GPU, coupled env+target augment, DNS-Noise)
Browse files
README.md
CHANGED
|
@@ -13,62 +13,71 @@ library_name: transformers
|
|
| 13 |
pipeline_tag: text-to-speech
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# LongCat-AudioDiT Env-TTS —
|
| 17 |
|
| 18 |
-
Fine-tune of [meituan-longcat/LongCat-AudioDiT-1B](https://huggingface.co/meituan-longcat/LongCat-AudioDiT-1B)
|
| 19 |
-
**three-stream env-tts task**: given a reference environment audio, a
|
| 20 |
-
speaker audio, and three text streams (env caption / speaker caption /
|
| 21 |
-
speech text), generate target speech that places the target text in the
|
| 22 |
referenced environment with the referenced speaker timbre.
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
## Differences from the base model
|
| 25 |
|
| 26 |
-
|
| 27 |
-
text-space):
|
| 28 |
|
| 29 |
```
|
| 30 |
latent sequence : [<boe> z_env <bos> z_spk <bon> z_target]
|
| 31 |
text sequence : [<boe_t> env_text_emb <bos_t> spk_text_emb <bon_t> target_text_emb]
|
| 32 |
```
|
| 33 |
|
| 34 |
-
`encode_multistream_text(
|
| 35 |
-
|
| 36 |
-
accepts a pre-assembled `prompt_latent` (replaces `prompt_audio`) so the inference
|
| 37 |
-
path can feed the boundary-tokenized three-stream prompt directly.
|
| 38 |
|
| 39 |
## Training summary
|
| 40 |
|
| 41 |
| Field | Value |
|
| 42 |
|---|---|
|
| 43 |
-
| Steps |
|
| 44 |
-
|
|
|
|
|
| 45 |
| Learning rate | cosine 5e-5 (warmup 250) |
|
| 46 |
| AdamW | β₁=0.9, β₂=0.999, wd=0.01 |
|
| 47 |
| EMA | disabled |
|
| 48 |
| LoRA | r=32, alpha=32, target = attn + ffn |
|
| 49 |
-
| Full-train | boundary tokens + AdaLN + text_conv +
|
| 50 |
-
| Audio filter | target duration ∈ [3, 45] s |
|
| 51 |
-
| RMS normalize | three-stream independent to **-23 dBFS** (target_rms=0.0708) |
|
| 52 |
-
| Augmentation | noise + RIR on spk_audio (DNS5 64GB) |
|
| 53 |
| Data | [ChristianYang/Env-TTS-Clean](https://huggingface.co/datasets/ChristianYang/Env-TTS-Clean) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
## How to load
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
```python
|
| 60 |
from transformers import AutoModel, AutoTokenizer
|
| 61 |
|
| 62 |
model = AutoModel.from_pretrained(
|
| 63 |
-
"
|
| 64 |
trust_remote_code=True,
|
| 65 |
).cuda().eval()
|
| 66 |
|
| 67 |
tokenizer = AutoTokenizer.from_pretrained(model.config.text_encoder_model)
|
| 68 |
```
|
| 69 |
|
| 70 |
-
|
| 71 |
-
env/spk text) see the training repo's `tasks/inference.py`.
|
| 72 |
|
| 73 |
## License
|
| 74 |
|
|
|
|
| 13 |
pipeline_tag: text-to-speech
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# LongCat-AudioDiT Env-TTS — `augment` (10,000-step fine-tune)
|
| 17 |
|
| 18 |
+
Fine-tune of [meituan-longcat/LongCat-AudioDiT-1B](https://huggingface.co/meituan-longcat/LongCat-AudioDiT-1B)
|
| 19 |
+
for the **three-stream env-tts task**: given a reference environment audio, a
|
| 20 |
+
reference speaker audio, and three text streams (env caption / speaker caption /
|
| 21 |
+
target speech text), generate target speech that places the target text in the
|
| 22 |
referenced environment with the referenced speaker timbre.
|
| 23 |
|
| 24 |
+
This `augment` variant adds **environment-consistent augmentation** so the
|
| 25 |
+
generated target lives in the referenced acoustic scene.
|
| 26 |
+
|
| 27 |
## Differences from the base model
|
| 28 |
|
| 29 |
+
Six learnable boundary tokens (three latent-space, three text-space):
|
|
|
|
| 30 |
|
| 31 |
```
|
| 32 |
latent sequence : [<boe> z_env <bos> z_spk <bon> z_target]
|
| 33 |
text sequence : [<boe_t> env_text_emb <bos_t> spk_text_emb <bon_t> target_text_emb]
|
| 34 |
```
|
| 35 |
|
| 36 |
+
`encode_multistream_text(...)` is the entry-point; `AudioDiTModel.forward(...)`
|
| 37 |
+
also accepts a pre-assembled `prompt_latent`.
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Training summary
|
| 40 |
|
| 41 |
| Field | Value |
|
| 42 |
|---|---|
|
| 43 |
+
| Steps | 10,000 |
|
| 44 |
+
| Hardware | 1× RTX PRO 6000 Blackwell (96 GB), bf16 |
|
| 45 |
+
| Effective batch | 16 × grad_accum 2 × 1 GPU = **32 rows / step** |
|
| 46 |
| Learning rate | cosine 5e-5 (warmup 250) |
|
| 47 |
| AdamW | β₁=0.9, β₂=0.999, wd=0.01 |
|
| 48 |
| EMA | disabled |
|
| 49 |
| LoRA | r=32, alpha=32, target = attn + ffn |
|
| 50 |
+
| Full-train | boundary tokens + AdaLN + text_conv + latent / latent_cond / input embeds + output_proj + time_embed |
|
|
|
|
|
|
|
|
|
|
| 51 |
| Data | [ChristianYang/Env-TTS-Clean](https://huggingface.co/datasets/ChristianYang/Env-TTS-Clean) |
|
| 52 |
+
| Audio | target ∈ [3, 15] s; three-stream RMS-norm to −23 dBFS; peak-clip at 0.5 |
|
| 53 |
+
|
| 54 |
+
### Augmentation (the `augment` change)
|
| 55 |
+
|
| 56 |
+
Noise + RIR are streamed on-demand from
|
| 57 |
+
[ChristianYang/DNS-Noise](https://huggingface.co/datasets/ChristianYang/DNS-Noise)
|
| 58 |
+
(DNS-Challenge `noise_fullband` + `impulse_responses`, republished as 24 kHz mono):
|
| 59 |
+
|
| 60 |
+
- **Speaker ref** — an independent 50/25/25 draw: clean / noise / noise+RIR, SNR ∈ [−5, 15] dB.
|
| 61 |
+
- **Env + target (coupled)** — a *separate* 50/25/25 draw whose **same** noise clip and
|
| 62 |
+
**same** RIR are applied to **both** env and target, placing the generated target in one
|
| 63 |
+
consistent acoustic scene. The RIR tail is kept; env/target are capped to 15 s.
|
| 64 |
|
| 65 |
## How to load
|
| 66 |
|
| 67 |
+
Uses custom code in this repo, so pass `trust_remote_code=True`:
|
| 68 |
|
| 69 |
```python
|
| 70 |
from transformers import AutoModel, AutoTokenizer
|
| 71 |
|
| 72 |
model = AutoModel.from_pretrained(
|
| 73 |
+
"ChristianYang/LongCat-AudioDiT-Env-TTS-1B-augment",
|
| 74 |
trust_remote_code=True,
|
| 75 |
).cuda().eval()
|
| 76 |
|
| 77 |
tokenizer = AutoTokenizer.from_pretrained(model.config.text_encoder_model)
|
| 78 |
```
|
| 79 |
|
| 80 |
+
See the training repo's `tasks/inference.py` for end-to-end env-tts inference.
|
|
|
|
| 81 |
|
| 82 |
## License
|
| 83 |
|