mova-tts 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mova_tts-0.1.0/.gitignore +10 -0
- mova_tts-0.1.0/LICENSE +201 -0
- mova_tts-0.1.0/LICENSES/ipa-uk.txt +21 -0
- mova_tts-0.1.0/PKG-INFO +161 -0
- mova_tts-0.1.0/README.md +121 -0
- mova_tts-0.1.0/examples/voice_cv.txt +1 -0
- mova_tts-0.1.0/examples/voice_cv.wav +0 -0
- mova_tts-0.1.0/pyproject.toml +62 -0
- mova_tts-0.1.0/src/mova_tts/__init__.py +6 -0
- mova_tts-0.1.0/src/mova_tts/_ipa_uk.py +406 -0
- mova_tts-0.1.0/src/mova_tts/cli.py +49 -0
- mova_tts-0.1.0/src/mova_tts/frontend.py +165 -0
- mova_tts-0.1.0/src/mova_tts/stream.py +55 -0
- mova_tts-0.1.0/src/mova_tts/tts.py +308 -0
- mova_tts-0.1.0/tests/test_fast.py +170 -0
- mova_tts-0.1.0/tests/test_synth.py +20 -0
mova_tts-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 lang-uk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
mova_tts-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mova-tts
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ukrainian text-to-speech with voice cloning: a NeuTTS-Air fine-tune, streaming on CPU, Apple and NVIDIA GPUs
|
|
5
|
+
Project-URL: Repository, https://github.com/MykhailoMS/mova-tts
|
|
6
|
+
Project-URL: Issues, https://github.com/MykhailoMS/mova-tts/issues
|
|
7
|
+
Project-URL: Model, https://huggingface.co/Mikhailo/mova-tts
|
|
8
|
+
Author: Mykhailo Mulesa
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: LICENSES/ipa-uk.txt
|
|
12
|
+
Keywords: gguf,neutts,speech,text-to-speech,tts,ukrainian,voice cloning
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Natural Language :: Ukrainian
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
24
|
+
Requires-Python: <3.14,>=3.10
|
|
25
|
+
Requires-Dist: ctranslate2>=4.0
|
|
26
|
+
Requires-Dist: huggingface-hub>=0.23
|
|
27
|
+
Requires-Dist: llama-cpp-python>=0.3.16
|
|
28
|
+
Requires-Dist: naholos>=0.1.0
|
|
29
|
+
Requires-Dist: neucodec>=0.0.4
|
|
30
|
+
Requires-Dist: numpy>=1.24
|
|
31
|
+
Requires-Dist: onnxruntime>=1.18
|
|
32
|
+
Requires-Dist: resemble-perth>=1.0.1
|
|
33
|
+
Requires-Dist: scipy>=1.10
|
|
34
|
+
Requires-Dist: sentencepiece>=0.2
|
|
35
|
+
Requires-Dist: soundfile>=0.12
|
|
36
|
+
Requires-Dist: torchao<0.18
|
|
37
|
+
Provides-Extra: test
|
|
38
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# mova-tts
|
|
42
|
+
|
|
43
|
+
Ukrainian text-to-speech with voice cloning. The model is a fine-tune of
|
|
44
|
+
[neuphonic/neutts-air](https://huggingface.co/neuphonic/neutts-air) on ~1780 hours of Ukrainian
|
|
45
|
+
speech. It runs through llama.cpp (GGUF) with the [NeuCodec](https://huggingface.co/neuphonic/neucodec)
|
|
46
|
+
audio codec. It streams, with the first audio after 0.16 s on an RTX 4090, and it runs faster
|
|
47
|
+
than real time on a CPU.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install mova-tts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from mova_tts import MovaTTS
|
|
55
|
+
|
|
56
|
+
tts = MovaTTS() # downloads the model on first use
|
|
57
|
+
voice = tts.voice("me.wav", "Точний текст, який звучить у записі.")
|
|
58
|
+
wav = tts.synthesize("Доброго дня! Сьогодні я розповім вам про нашу нову систему.", voice)
|
|
59
|
+
tts.save(wav, "out.wav")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Clone any voice from a clean 3–12 second recording plus the exact text spoken in it. Encode a
|
|
63
|
+
voice once and reuse it with `voice.save("me.npz")` and `Voice.load("me.npz")`. There is an
|
|
64
|
+
example voice from Common Voice (CC0) in `examples/`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
mova-tts "Доброго дня! Як ваші справи?" --ref examples/voice_cv.wav \
|
|
68
|
+
--ref-text "$(cat examples/voice_cv.txt)" -o out.wav
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Streaming
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
for chunk in tts.stream("Перше речення. Друге речення.", voice):
|
|
75
|
+
play(chunk) # float32, 24 kHz mono
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Audio comes in one-second chunks. The first chunk is 0.2 s long and needs 35 generated codes.
|
|
79
|
+
Long text is generated sentence by sentence.
|
|
80
|
+
|
|
81
|
+
## Speed
|
|
82
|
+
|
|
83
|
+
Time to first audio (front-end included) and real-time factor (RTF: generation time divided
|
|
84
|
+
by audio length). Median over 6 sentences, measured on one machine:
|
|
85
|
+
|
|
86
|
+
| hardware | first audio | RTF |
|
|
87
|
+
|---|---:|---:|
|
|
88
|
+
| NVIDIA RTX 4090 (Q8_0 or Q4_K_M) | 0.16 s | 0.14 |
|
|
89
|
+
| Intel i9-13900KF, CPU only, 8 threads (Q8_0 or Q4_K_M) | 1.0 s | 0.72 |
|
|
90
|
+
|
|
91
|
+
`device="auto"` uses CUDA if it is available, then the Apple GPU (Metal), then the CPU. On the
|
|
92
|
+
CPU and on a Mac, the audio is decoded with the NeuCodec ONNX decoder. On the CPU, set
|
|
93
|
+
`threads=` to the number of performance cores. More threads than that slow it down.
|
|
94
|
+
|
|
95
|
+
## Quality
|
|
96
|
+
|
|
97
|
+
The model was evaluated on 234 held-out sentences (Common Voice and audiobooks, speakers never
|
|
98
|
+
seen in training), cloning each speaker from a different sentence of theirs. Each sentence is
|
|
99
|
+
sampled, so every row gives the range over 3 seeds (2 for Q4_K_M):
|
|
100
|
+
|
|
101
|
+
| | WER | CER | UTMOS | speaker similarity |
|
|
102
|
+
|---|---:|---:|---:|---:|
|
|
103
|
+
| `synthesize()`, Q8_0 | 0.123–0.140 | 0.035–0.041 | 3.45 | 0.48–0.50 |
|
|
104
|
+
| `stream()`, Q8_0 | 0.135–0.140 | 0.041–0.046 | 3.37 | 0.48–0.50 |
|
|
105
|
+
| `stream()`, Q4_K_M | 0.131–0.135 | 0.041 | 3.33 | 0.48–0.49 |
|
|
106
|
+
|
|
107
|
+
WER and CER come from Whisper large-v3 transcripts of the generated audio. UTMOS is a
|
|
108
|
+
predicted naturalness score from 1 to 5. Speaker similarity is the ECAPA cosine to the
|
|
109
|
+
speaker's real recordings. A take that does not stop, or stops too early, is regenerated
|
|
110
|
+
with another seed. `stream()` can do that only before its first chunk is out.
|
|
111
|
+
|
|
112
|
+
## Text front-end
|
|
113
|
+
|
|
114
|
+
1. Clean-up, then numbers, dates and units turned into words with
|
|
115
|
+
[skypro1111/m2m100-ukr-verbalization](https://huggingface.co/skypro1111/m2m100-ukr-verbalization).
|
|
116
|
+
That model (~0.5 GB) downloads the first time a text contains digits.
|
|
117
|
+
2. Latin words transliterated, with acronyms spelled out by letter names: CRM becomes сі-ар-ем.
|
|
118
|
+
3. Stress from [naholos](https://github.com/MykhailoMS/naholos).
|
|
119
|
+
4. IPA from [ipa-uk](https://github.com/patriotyk/ipa-uk), vendored here under MIT.
|
|
120
|
+
|
|
121
|
+
If a word is stressed wrong, mark it yourself and your mark always wins. You can write
|
|
122
|
+
`за+мок` or `за́мок` in the text, or keep a list of such words in a file:
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
tts = MovaTTS(user_dict="my_words.txt") # one stressed word per line: за+мок
|
|
126
|
+
print(tts.frontend.stressed("Старий замок")) # check the stress before synthesis
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Options
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
MovaTTS(quant="Q4_K_M") # smaller model: 0.6 GB instead of 0.8 GB
|
|
133
|
+
MovaTTS(device="cpu") # "auto" | "cuda" | "metal" | "cpu"
|
|
134
|
+
MovaTTS(seed=42) # repeatable takes; default is a new take every call
|
|
135
|
+
MovaTTS(watermark=False) # synthesize() adds a Perth watermark by default
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Each take is sampled, so it sounds a little different every time. Sometimes a take stretches
|
|
139
|
+
a word or pauses oddly. If that happens, generate again or use another seed.
|
|
140
|
+
|
|
141
|
+
## Model and training
|
|
142
|
+
|
|
143
|
+
- Base: [neuphonic/neutts-air](https://huggingface.co/neuphonic/neutts-air), a 0.7B Qwen-based
|
|
144
|
+
speech language model (Apache-2.0). It was fully fine-tuned in two stages: 12k steps on a
|
|
145
|
+
740-hour subset, then 20k steps on all the data.
|
|
146
|
+
- Data: ~1780 hours of Ukrainian speech: audiobooks read by professional narrators, podcasts,
|
|
147
|
+
Common Voice, and studio voice recordings. All audio was re-encoded with NeuCodec. Stress
|
|
148
|
+
labels come from the recordings themselves: the text was aligned with the Montreal Forced
|
|
149
|
+
Aligner, and an acoustic detector marked the stress each speaker actually used.
|
|
150
|
+
- Weights: [Mikhailo/mova-tts](https://huggingface.co/Mikhailo/mova-tts) holds safetensors (for
|
|
151
|
+
transformers) and GGUF Q8_0 and Q4_K_M files (for llama.cpp).
|
|
152
|
+
|
|
153
|
+
## Responsible use
|
|
154
|
+
|
|
155
|
+
Clone only voices you have permission to use. `synthesize()` output carries the imperceptible
|
|
156
|
+
[Perth](https://github.com/resemble-ai/Perth) watermark, so generated audio can be detected.
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
Code and model: Apache-2.0, like NeuTTS-Air and NeuCodec. The vendored ipa-uk is MIT
|
|
161
|
+
(`LICENSES/ipa-uk.txt`).
|
mova_tts-0.1.0/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# mova-tts
|
|
2
|
+
|
|
3
|
+
Ukrainian text-to-speech with voice cloning. The model is a fine-tune of
|
|
4
|
+
[neuphonic/neutts-air](https://huggingface.co/neuphonic/neutts-air) on ~1780 hours of Ukrainian
|
|
5
|
+
speech. It runs through llama.cpp (GGUF) with the [NeuCodec](https://huggingface.co/neuphonic/neucodec)
|
|
6
|
+
audio codec. It streams, with the first audio after 0.16 s on an RTX 4090, and it runs faster
|
|
7
|
+
than real time on a CPU.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install mova-tts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from mova_tts import MovaTTS
|
|
15
|
+
|
|
16
|
+
tts = MovaTTS() # downloads the model on first use
|
|
17
|
+
voice = tts.voice("me.wav", "Точний текст, який звучить у записі.")
|
|
18
|
+
wav = tts.synthesize("Доброго дня! Сьогодні я розповім вам про нашу нову систему.", voice)
|
|
19
|
+
tts.save(wav, "out.wav")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Clone any voice from a clean 3–12 second recording plus the exact text spoken in it. Encode a
|
|
23
|
+
voice once and reuse it with `voice.save("me.npz")` and `Voice.load("me.npz")`. There is an
|
|
24
|
+
example voice from Common Voice (CC0) in `examples/`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
mova-tts "Доброго дня! Як ваші справи?" --ref examples/voice_cv.wav \
|
|
28
|
+
--ref-text "$(cat examples/voice_cv.txt)" -o out.wav
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Streaming
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
for chunk in tts.stream("Перше речення. Друге речення.", voice):
|
|
35
|
+
play(chunk) # float32, 24 kHz mono
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Audio comes in one-second chunks. The first chunk is 0.2 s long and needs 35 generated codes.
|
|
39
|
+
Long text is generated sentence by sentence.
|
|
40
|
+
|
|
41
|
+
## Speed
|
|
42
|
+
|
|
43
|
+
Time to first audio (front-end included) and real-time factor (RTF: generation time divided
|
|
44
|
+
by audio length). Median over 6 sentences, measured on one machine:
|
|
45
|
+
|
|
46
|
+
| hardware | first audio | RTF |
|
|
47
|
+
|---|---:|---:|
|
|
48
|
+
| NVIDIA RTX 4090 (Q8_0 or Q4_K_M) | 0.16 s | 0.14 |
|
|
49
|
+
| Intel i9-13900KF, CPU only, 8 threads (Q8_0 or Q4_K_M) | 1.0 s | 0.72 |
|
|
50
|
+
|
|
51
|
+
`device="auto"` uses CUDA if it is available, then the Apple GPU (Metal), then the CPU. On the
|
|
52
|
+
CPU and on a Mac, the audio is decoded with the NeuCodec ONNX decoder. On the CPU, set
|
|
53
|
+
`threads=` to the number of performance cores. More threads than that slow it down.
|
|
54
|
+
|
|
55
|
+
## Quality
|
|
56
|
+
|
|
57
|
+
The model was evaluated on 234 held-out sentences (Common Voice and audiobooks, speakers never
|
|
58
|
+
seen in training), cloning each speaker from a different sentence of theirs. Each sentence is
|
|
59
|
+
sampled, so every row gives the range over 3 seeds (2 for Q4_K_M):
|
|
60
|
+
|
|
61
|
+
| | WER | CER | UTMOS | speaker similarity |
|
|
62
|
+
|---|---:|---:|---:|---:|
|
|
63
|
+
| `synthesize()`, Q8_0 | 0.123–0.140 | 0.035–0.041 | 3.45 | 0.48–0.50 |
|
|
64
|
+
| `stream()`, Q8_0 | 0.135–0.140 | 0.041–0.046 | 3.37 | 0.48–0.50 |
|
|
65
|
+
| `stream()`, Q4_K_M | 0.131–0.135 | 0.041 | 3.33 | 0.48–0.49 |
|
|
66
|
+
|
|
67
|
+
WER and CER come from Whisper large-v3 transcripts of the generated audio. UTMOS is a
|
|
68
|
+
predicted naturalness score from 1 to 5. Speaker similarity is the ECAPA cosine to the
|
|
69
|
+
speaker's real recordings. A take that does not stop, or stops too early, is regenerated
|
|
70
|
+
with another seed. `stream()` can do that only before its first chunk is out.
|
|
71
|
+
|
|
72
|
+
## Text front-end
|
|
73
|
+
|
|
74
|
+
1. Clean-up, then numbers, dates and units turned into words with
|
|
75
|
+
[skypro1111/m2m100-ukr-verbalization](https://huggingface.co/skypro1111/m2m100-ukr-verbalization).
|
|
76
|
+
That model (~0.5 GB) downloads the first time a text contains digits.
|
|
77
|
+
2. Latin words transliterated, with acronyms spelled out by letter names: CRM becomes сі-ар-ем.
|
|
78
|
+
3. Stress from [naholos](https://github.com/MykhailoMS/naholos).
|
|
79
|
+
4. IPA from [ipa-uk](https://github.com/patriotyk/ipa-uk), vendored here under MIT.
|
|
80
|
+
|
|
81
|
+
If a word is stressed wrong, mark it yourself and your mark always wins. You can write
|
|
82
|
+
`за+мок` or `за́мок` in the text, or keep a list of such words in a file:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
tts = MovaTTS(user_dict="my_words.txt") # one stressed word per line: за+мок
|
|
86
|
+
print(tts.frontend.stressed("Старий замок")) # check the stress before synthesis
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Options
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
MovaTTS(quant="Q4_K_M") # smaller model: 0.6 GB instead of 0.8 GB
|
|
93
|
+
MovaTTS(device="cpu") # "auto" | "cuda" | "metal" | "cpu"
|
|
94
|
+
MovaTTS(seed=42) # repeatable takes; default is a new take every call
|
|
95
|
+
MovaTTS(watermark=False) # synthesize() adds a Perth watermark by default
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Each take is sampled, so it sounds a little different every time. Sometimes a take stretches
|
|
99
|
+
a word or pauses oddly. If that happens, generate again or use another seed.
|
|
100
|
+
|
|
101
|
+
## Model and training
|
|
102
|
+
|
|
103
|
+
- Base: [neuphonic/neutts-air](https://huggingface.co/neuphonic/neutts-air), a 0.7B Qwen-based
|
|
104
|
+
speech language model (Apache-2.0). It was fully fine-tuned in two stages: 12k steps on a
|
|
105
|
+
740-hour subset, then 20k steps on all the data.
|
|
106
|
+
- Data: ~1780 hours of Ukrainian speech: audiobooks read by professional narrators, podcasts,
|
|
107
|
+
Common Voice, and studio voice recordings. All audio was re-encoded with NeuCodec. Stress
|
|
108
|
+
labels come from the recordings themselves: the text was aligned with the Montreal Forced
|
|
109
|
+
Aligner, and an acoustic detector marked the stress each speaker actually used.
|
|
110
|
+
- Weights: [Mikhailo/mova-tts](https://huggingface.co/Mikhailo/mova-tts) holds safetensors (for
|
|
111
|
+
transformers) and GGUF Q8_0 and Q4_K_M files (for llama.cpp).
|
|
112
|
+
|
|
113
|
+
## Responsible use
|
|
114
|
+
|
|
115
|
+
Clone only voices you have permission to use. `synthesize()` output carries the imperceptible
|
|
116
|
+
[Perth](https://github.com/resemble-ai/Perth) watermark, so generated audio can be detected.
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
Code and model: Apache-2.0, like NeuTTS-Air and NeuCodec. The vendored ipa-uk is MIT
|
|
121
|
+
(`LICENSES/ipa-uk.txt`).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Він доклав великих зусиль, спрямованих на відродження та виживання кримського народу.
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mova-tts"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Ukrainian text-to-speech with voice cloning: a NeuTTS-Air fine-tune, streaming on CPU, Apple and NVIDIA GPUs"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE", "LICENSES/*"]
|
|
12
|
+
requires-python = ">=3.10,<3.14"
|
|
13
|
+
authors = [{ name = "Mykhailo Mulesa" }]
|
|
14
|
+
keywords = ["ukrainian", "tts", "text-to-speech", "voice cloning", "neutts", "gguf", "speech"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Development Status :: 4 - Beta",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Intended Audience :: Science/Research",
|
|
25
|
+
"Natural Language :: Ukrainian",
|
|
26
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"naholos>=0.1.0",
|
|
30
|
+
"llama-cpp-python>=0.3.16",
|
|
31
|
+
"neucodec>=0.0.4",
|
|
32
|
+
"torchao<0.18", # neucodec -> torchtune 0.6 imports torchao.dtypes.nf4tensor (gone in 0.18)
|
|
33
|
+
"onnxruntime>=1.18",
|
|
34
|
+
"resemble-perth>=1.0.1",
|
|
35
|
+
"soundfile>=0.12",
|
|
36
|
+
"scipy>=1.10",
|
|
37
|
+
"numpy>=1.24",
|
|
38
|
+
"huggingface-hub>=0.23",
|
|
39
|
+
"ctranslate2>=4.0",
|
|
40
|
+
"sentencepiece>=0.2",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.optional-dependencies]
|
|
44
|
+
test = ["pytest>=8"]
|
|
45
|
+
|
|
46
|
+
[project.scripts]
|
|
47
|
+
mova-tts = "mova_tts.cli:main"
|
|
48
|
+
|
|
49
|
+
[project.urls]
|
|
50
|
+
Repository = "https://github.com/MykhailoMS/mova-tts"
|
|
51
|
+
Issues = "https://github.com/MykhailoMS/mova-tts/issues"
|
|
52
|
+
Model = "https://huggingface.co/Mikhailo/mova-tts"
|
|
53
|
+
|
|
54
|
+
[tool.hatch.build.targets.wheel]
|
|
55
|
+
packages = ["src/mova_tts"]
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.sdist]
|
|
58
|
+
include = ["src/mova_tts", "tests", "examples", "README.md", "LICENSE", "LICENSES", "pyproject.toml"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|
|
62
|
+
markers = ["slow: downloads the model (~0.8 GB) and synthesizes"]
|