xlians555 commited on
Commit
9e7be68
·
verified ·
1 Parent(s): c99dadd

Add streaming config and update model card

Browse files
Files changed (2) hide show
  1. README.md +37 -8
  2. config.json +6 -0
README.md CHANGED
@@ -8,6 +8,8 @@ tags:
8
  - audio
9
  - speech-synthesis
10
  - voice-cloning
 
 
11
  - autoregressive
12
  - meanflow
13
  - two-step
@@ -21,27 +23,54 @@ tags:
21
  <a href="https://studio-dots-ai.github.io/dots.tts-demo/"><img src="https://img.shields.io/badge/Demo%20Page-Live-red" alt="Demo Page"></a>
22
  </p>
23
 
24
- This repository provides a standalone dots.tts artifact for **fixed two-step STTS inference**.
25
- The sampling contract is stored in `config.json` and selected automatically.
26
- Sampling options should be omitted.
27
 
28
  ## Quick start
29
 
30
  ```python
31
- from dots_tts.runtime import DotsTtsRuntime
 
32
 
33
- runtime = DotsTtsRuntime.from_pretrained(
 
 
34
  "dots-studio/dots.tts-mf-2steps-stts",
35
  precision="bfloat16",
 
 
 
 
 
 
 
 
 
 
36
  )
37
- result = runtime.generate(text="Hello from two-step MeanFlow.")
 
 
 
 
 
 
 
 
 
 
 
38
  ```
39
 
40
- Passing incompatible sampling values raises an error.
 
 
 
41
 
42
  ## Scope and limitations
43
 
44
- This model is intended for fixed two-step inference. Other sampling settings are not claimed.
45
  High-fidelity voice cloning must be used only with authorization and consent; do not use it
46
  for impersonation, fraud, or disinformation.
47
 
 
8
  - audio
9
  - speech-synthesis
10
  - voice-cloning
11
+ - streaming-tts
12
+ - double-streaming
13
  - autoregressive
14
  - meanflow
15
  - two-step
 
23
  <a href="https://studio-dots-ai.github.io/dots.tts-demo/"><img src="https://img.shields.io/badge/Demo%20Page-Live-red" alt="Demo Page"></a>
24
  </p>
25
 
26
+ This repository provides a standalone dots.tts artifact for **fixed two-step double-streaming TTS inference**.
27
+ The sampling and streaming contracts are stored in `config.json` and selected automatically.
28
+ Sampling and streaming cadence options should be omitted.
29
 
30
  ## Quick start
31
 
32
  ```python
33
+ import torch
34
+ import soundfile as sf
35
 
36
+ from dots_tts.runtime_double_streaming import DotsTtsRuntimeDoubleStreaming
37
+
38
+ runtime = DotsTtsRuntimeDoubleStreaming.from_pretrained(
39
  "dots-studio/dots.tts-mf-2steps-stts",
40
  precision="bfloat16",
41
+ optimize=True,
42
+ max_generate_length=500,
43
+ )
44
+
45
+ text = "Hello from two-step double streaming."
46
+ text_token_ids = runtime.model.tokenizer.encode(text, add_special_tokens=False)
47
+
48
+ session = runtime.start_double_streaming(
49
+ prompt_audio_path="/path/to/reference.wav",
50
+ prompt_text="The exact transcript spoken in the reference audio.",
51
  )
52
+
53
+ chunks = []
54
+ for token_id in text_token_ids:
55
+ chunk = session.push_text_token(token_id)
56
+ if chunk is not None:
57
+ chunks.append(chunk.detach().cpu())
58
+
59
+ for chunk in session.finish_text():
60
+ chunks.append(chunk.detach().cpu())
61
+
62
+ audio = torch.cat(chunks, dim=-1).float().squeeze().numpy()
63
+ sf.write("double_streaming.wav", audio, runtime.sample_rate)
64
  ```
65
 
66
+ For a complete command-line example, see
67
+ [`scripts/example_double_streaming.py`](https://github.com/studio-dots-ai/dots.tts/blob/main/scripts/example_double_streaming.py).
68
+
69
+ Passing incompatible sampling values raises an error. Streaming cadence is selected from the artifact configuration.
70
 
71
  ## Scope and limitations
72
 
73
+ This model is intended for fixed two-step double-streaming inference. Other sampling or streaming settings are not claimed.
74
  High-fidelity voice cloning must be used only with authorization and consent; do not use it
75
  for impersonation, fraud, or disinformation.
76
 
config.json CHANGED
@@ -127,5 +127,11 @@
127
  "num_steps": 2,
128
  "guidance_scale": 0.0,
129
  "tau_mid": 1.3
 
 
 
 
 
 
130
  }
131
  }
 
127
  "num_steps": 2,
128
  "guidance_scale": 0.0,
129
  "tau_mid": 1.3
130
+ },
131
+ "streaming": {
132
+ "interleave_mode": "buffered_ratio",
133
+ "initial_lookahead": 3,
134
+ "warmup_ta": 0,
135
+ "ta_per_tta": 1
136
  }
137
  }