Text-to-Speech
Transformers
ONNX
teratts_onnx
feature-extraction
onnxruntime
russian
english
custom-code
custom_code
Instructions to use TeraSpace/TeraTTSv2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TeraSpace/TeraTTSv2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="TeraSpace/TeraTTSv2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TeraSpace/TeraTTSv2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Replace voice styles with clean-25s style_flacs speakers
Browse files- README.md +5 -5
- config.json +3 -1
- configuration_teratts.py +4 -0
- styles/{en_female → eng_f3}/style_dp.npy +1 -1
- styles/{masha_ls → eng_f3}/style_ttl.npy +1 -1
- styles/{ru_female → eng_f4_whisper}/style_dp.npy +1 -1
- styles/{en_female → eng_f4_whisper}/style_ttl.npy +1 -1
- styles/{en_male → eng_f5}/style_dp.npy +1 -1
- styles/{mita → eng_f5}/style_ttl.npy +1 -1
- styles/{ru_male → eng_m2_whisper}/style_dp.npy +1 -1
- styles/{en_male → eng_m2_whisper}/style_ttl.npy +1 -1
- styles/eng_m3/style_dp.npy +3 -0
- styles/eng_m3/style_ttl.npy +3 -0
- styles/eng_m4/style_dp.npy +3 -0
- styles/eng_m4/style_ttl.npy +3 -0
- styles/{mita → ru_f1}/style_dp.npy +0 -0
- styles/ru_f1/style_ttl.npy +3 -0
- styles/{masha_ls → ru_f2}/style_dp.npy +0 -0
- styles/ru_f2/style_ttl.npy +3 -0
- styles/ru_female/style_ttl.npy +0 -3
- styles/ru_m1/style_dp.npy +3 -0
- styles/ru_m1/style_ttl.npy +3 -0
- styles/ru_m5/style_dp.npy +3 -0
- styles/ru_m5/style_ttl.npy +3 -0
- styles/ru_male/style_ttl.npy +0 -3
README.md
CHANGED
|
@@ -40,8 +40,8 @@ tts = AutoModel.from_pretrained(
|
|
| 40 |
)
|
| 41 |
|
| 42 |
waveform = tts.generate_speech(
|
| 43 |
-
"<
|
| 44 |
-
voice="
|
| 45 |
duration_scale=1,
|
| 46 |
)
|
| 47 |
tts.save_wav("teratts.wav", waveform)
|
|
@@ -54,7 +54,7 @@ standard signed-16-bit PCM WAV without an extra audio package.
|
|
| 54 |
|
| 55 |
| Control | Values | Effect |
|
| 56 |
| --- | --- | --- |
|
| 57 |
-
| `voice` | `
|
| 58 |
| `duration_scale` | Positive float, default `1` | Higher values produce slower, longer speech. |
|
| 59 |
| `diffusion_model` | `distilled` (default), `teacher` | Distilled is faster; teacher supports adjustable CFG. |
|
| 60 |
| `ruaccent_mode` | `full` (default), `dictionary` | Full uses RUAccent neural ONNX graphs plus dictionaries; dictionary mode loads dictionaries only. |
|
|
@@ -83,7 +83,7 @@ expanded to words in the matching language before synthesis:
|
|
| 83 |
```python
|
| 84 |
waveform = tts.generate_speech(
|
| 85 |
"<ru>У меня 21 яблоко.</ru> <en>I have 42 apples.</en>",
|
| 86 |
-
voice="
|
| 87 |
duration_scale=1,
|
| 88 |
)
|
| 89 |
```
|
|
@@ -112,7 +112,7 @@ automatic Russian stress processing entirely.
|
|
| 112 |
```python
|
| 113 |
for chunk in tts.generate_speech_stream(
|
| 114 |
"<en>Streaming speech is ready.</en>",
|
| 115 |
-
voice="
|
| 116 |
duration_scale=1,
|
| 117 |
):
|
| 118 |
# Send float32 mono chunks (44,100 Hz) to a player or network client.
|
|
|
|
| 40 |
)
|
| 41 |
|
| 42 |
waveform = tts.generate_speech(
|
| 43 |
+
"<ru>Привет от TeraTTS.</ru>",
|
| 44 |
+
voice="ru_f1",
|
| 45 |
duration_scale=1,
|
| 46 |
)
|
| 47 |
tts.save_wav("teratts.wav", waveform)
|
|
|
|
| 54 |
|
| 55 |
| Control | Values | Effect |
|
| 56 |
| --- | --- | --- |
|
| 57 |
+
| `voice` | `ru_f1`, `ru_f2`, `ru_m1`, `ru_m5`, `eng_f3`, `eng_f4_whisper`, `eng_f5`, `eng_m2_whisper`, `eng_m3`, `eng_m4` | Selects a bundled precomputed voice style named after its reference audio. |
|
| 58 |
| `duration_scale` | Positive float, default `1` | Higher values produce slower, longer speech. |
|
| 59 |
| `diffusion_model` | `distilled` (default), `teacher` | Distilled is faster; teacher supports adjustable CFG. |
|
| 60 |
| `ruaccent_mode` | `full` (default), `dictionary` | Full uses RUAccent neural ONNX graphs plus dictionaries; dictionary mode loads dictionaries only. |
|
|
|
|
| 83 |
```python
|
| 84 |
waveform = tts.generate_speech(
|
| 85 |
"<ru>У меня 21 яблоко.</ru> <en>I have 42 apples.</en>",
|
| 86 |
+
voice="ru_f1",
|
| 87 |
duration_scale=1,
|
| 88 |
)
|
| 89 |
```
|
|
|
|
| 112 |
```python
|
| 113 |
for chunk in tts.generate_speech_stream(
|
| 114 |
"<en>Streaming speech is ready.</en>",
|
| 115 |
+
voice="eng_f3",
|
| 116 |
duration_scale=1,
|
| 117 |
):
|
| 118 |
# Send float32 mono chunks (44,100 Hz) to a player or network client.
|
config.json
CHANGED
|
@@ -5,6 +5,8 @@
|
|
| 5 |
"AutoModel": "modeling_teratts.TeraTTSModel"
|
| 6 |
},
|
| 7 |
"default_diffusion_model": "distilled",
|
|
|
|
| 8 |
"model_type": "teratts_onnx",
|
| 9 |
-
"sample_rate": 44100
|
|
|
|
| 10 |
}
|
|
|
|
| 5 |
"AutoModel": "modeling_teratts.TeraTTSModel"
|
| 6 |
},
|
| 7 |
"default_diffusion_model": "distilled",
|
| 8 |
+
"default_voice": "ru_f1",
|
| 9 |
"model_type": "teratts_onnx",
|
| 10 |
+
"sample_rate": 44100,
|
| 11 |
+
"voices": ["eng_f3", "eng_f4_whisper", "eng_f5", "eng_m2_whisper", "eng_m3", "eng_m4", "ru_f1", "ru_f2", "ru_m1", "ru_m5"]
|
| 12 |
}
|
configuration_teratts.py
CHANGED
|
@@ -10,8 +10,12 @@ class TeraTTSConfig(PretrainedConfig):
|
|
| 10 |
self,
|
| 11 |
sample_rate: int = 44_100,
|
| 12 |
default_diffusion_model: str = "distilled",
|
|
|
|
|
|
|
| 13 |
**kwargs,
|
| 14 |
) -> None:
|
| 15 |
super().__init__(**kwargs)
|
| 16 |
self.sample_rate = sample_rate
|
| 17 |
self.default_diffusion_model = default_diffusion_model
|
|
|
|
|
|
|
|
|
| 10 |
self,
|
| 11 |
sample_rate: int = 44_100,
|
| 12 |
default_diffusion_model: str = "distilled",
|
| 13 |
+
default_voice: str = "ru_f1",
|
| 14 |
+
voices: list[str] | None = None,
|
| 15 |
**kwargs,
|
| 16 |
) -> None:
|
| 17 |
super().__init__(**kwargs)
|
| 18 |
self.sample_rate = sample_rate
|
| 19 |
self.default_diffusion_model = default_diffusion_model
|
| 20 |
+
self.default_voice = default_voice
|
| 21 |
+
self.voices = voices or []
|
styles/{en_female → eng_f3}/style_dp.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 640
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8471b25d2db5281feebc6e03af5bfb413c647368d75cdd8cebc44be36def7948
|
| 3 |
size 640
|
styles/{masha_ls → eng_f3}/style_ttl.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 51328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95fdfe490f5b3d3cf699495309177c405a38a89707bc9c711f93dc083fe099b6
|
| 3 |
size 51328
|
styles/{ru_female → eng_f4_whisper}/style_dp.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 640
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:47031c5fbbea490cba67cfd82f1ffc8ee8ed64c68aa68260f13746c2174ffbfa
|
| 3 |
size 640
|
styles/{en_female → eng_f4_whisper}/style_ttl.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 51328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae4a81c2459e4fccb6206b37c3bba518ac3e23fc91344b07516c5e6125257d59
|
| 3 |
size 51328
|
styles/{en_male → eng_f5}/style_dp.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 640
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9629dce9db38b4ab5163429c1eeb9a5771786e58e98e343ea6251bf93a9dfd60
|
| 3 |
size 640
|
styles/{mita → eng_f5}/style_ttl.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 51328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4cc8b6d271d6ee587b13af7bef8f0151821b24d6af546a1167fa885bd962496
|
| 3 |
size 51328
|
styles/{ru_male → eng_m2_whisper}/style_dp.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 640
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a2814cc92643cc102d438d0a70742bacbd01921a78cc0ff39b722ab78b2682c
|
| 3 |
size 640
|
styles/{en_male → eng_m2_whisper}/style_ttl.npy
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 51328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e651551d547ca305256bc56062df24c2706308ffccfc5b8ad9735f057975f270
|
| 3 |
size 51328
|
styles/eng_m3/style_dp.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dbcc78e880d2e7c6a45f4bff464ee90c9ba17a2599c9d3cc3dea2c0abcb94524
|
| 3 |
+
size 640
|
styles/eng_m3/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f0ffd38329830d1556e1096d396c2a807626b9308eb12af84ea4733c712d8d01
|
| 3 |
+
size 51328
|
styles/eng_m4/style_dp.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:526724e17a6d0d917c18db0bac6ac97af15ae63312375129ef294462fbbfc0a2
|
| 3 |
+
size 640
|
styles/eng_m4/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8d5016c1aade83d2bdec1e3aa86d0e421ff9e2fb7a781637e64f8a0d8ef663e
|
| 3 |
+
size 51328
|
styles/{mita → ru_f1}/style_dp.npy
RENAMED
|
File without changes
|
styles/ru_f1/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:489cb6d10f3e2528d7ac4b3e4d8b01ca54d44b98d193dd26684b16c3a24bd9a7
|
| 3 |
+
size 51328
|
styles/{masha_ls → ru_f2}/style_dp.npy
RENAMED
|
File without changes
|
styles/ru_f2/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4947fa632443f8ad8343399ac258f67f1e85e9594cf5d42ef7e18d6f6fa3e763
|
| 3 |
+
size 51328
|
styles/ru_female/style_ttl.npy
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:7f698b258230d56cce4bc344ff75ac789161dc25393cc6c44b82b119b9b7e9c5
|
| 3 |
-
size 51328
|
|
|
|
|
|
|
|
|
|
|
|
styles/ru_m1/style_dp.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0bbdbe5044f5682152b1fe399f7681424870e03023e857b9706863a6d73bf9e9
|
| 3 |
+
size 640
|
styles/ru_m1/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a49356abab63262e3183518eacadd9e073681f87b8bfd86f7b5aed0317fbd0c
|
| 3 |
+
size 51328
|
styles/ru_m5/style_dp.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:79741747bb75e0dac2357c089bc923926c4a34fe46b5ce9f85376b14b8e59bf9
|
| 3 |
+
size 640
|
styles/ru_m5/style_ttl.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6eccc64350dcc23a8e790eebd7abbec24b0055e6451d975deffa899885e26e99
|
| 3 |
+
size 51328
|
styles/ru_male/style_ttl.npy
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:fb75241f50286775de651047da65f9a074f465c5336e26ada43626d15fe82581
|
| 3 |
-
size 51328
|
|
|
|
|
|
|
|
|
|
|
|