Spaces:
Runtime error
Runtime error
Commit
·
fe29fc3
0
Parent(s):
init
Browse files- .gitattributes +37 -0
- .gitignore +10 -0
- LICENSE +332 -0
- README.md +12 -0
- app.py +296 -0
- examples/speaker0.mp3 +3 -0
- examples/speaker1.mp3 +3 -0
- examples/speaker2.mp3 +3 -0
- logo.jpg +0 -0
- open_voice.mp4 +3 -0
- packages.txt +1 -0
- requirements.txt +1 -0
.gitattributes
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__/
|
2 |
+
.ipynb_checkpoints/
|
3 |
+
processed
|
4 |
+
outputs
|
5 |
+
checkpoints
|
6 |
+
*.pyc
|
7 |
+
*.bak
|
8 |
+
*.ipynb
|
9 |
+
*.zip
|
10 |
+
OpenVoice/
|
LICENSE
ADDED
@@ -0,0 +1,332 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Creative Commons Attribution-NonCommercial 4.0 International Public
|
2 |
+
License
|
3 |
+
|
4 |
+
By exercising the Licensed Rights (defined below), You accept and agree
|
5 |
+
to be bound by the terms and conditions of this Creative Commons
|
6 |
+
Attribution-NonCommercial 4.0 International Public License ("Public
|
7 |
+
License"). To the extent this Public License may be interpreted as a
|
8 |
+
contract, You are granted the Licensed Rights in consideration of Your
|
9 |
+
acceptance of these terms and conditions, and the Licensor grants You
|
10 |
+
such rights in consideration of benefits the Licensor receives from
|
11 |
+
making the Licensed Material available under these terms and
|
12 |
+
conditions.
|
13 |
+
|
14 |
+
|
15 |
+
Section 1 -- Definitions.
|
16 |
+
|
17 |
+
a. Adapted Material means material subject to Copyright and Similar
|
18 |
+
Rights that is derived from or based upon the Licensed Material
|
19 |
+
and in which the Licensed Material is translated, altered,
|
20 |
+
arranged, transformed, or otherwise modified in a manner requiring
|
21 |
+
permission under the Copyright and Similar Rights held by the
|
22 |
+
Licensor. For purposes of this Public License, where the Licensed
|
23 |
+
Material is a musical work, performance, or sound recording,
|
24 |
+
Adapted Material is always produced where the Licensed Material is
|
25 |
+
synched in timed relation with a moving image.
|
26 |
+
|
27 |
+
b. Adapter's License means the license You apply to Your Copyright
|
28 |
+
and Similar Rights in Your contributions to Adapted Material in
|
29 |
+
accordance with the terms and conditions of this Public License.
|
30 |
+
|
31 |
+
c. Copyright and Similar Rights means copyright and/or similar rights
|
32 |
+
closely related to copyright including, without limitation,
|
33 |
+
performance, broadcast, sound recording, and Sui Generis Database
|
34 |
+
Rights, without regard to how the rights are labeled or
|
35 |
+
categorized. For purposes of this Public License, the rights
|
36 |
+
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
37 |
+
Rights.
|
38 |
+
d. Effective Technological Measures means those measures that, in the
|
39 |
+
absence of proper authority, may not be circumvented under laws
|
40 |
+
fulfilling obligations under Article 11 of the WIPO Copyright
|
41 |
+
Treaty adopted on December 20, 1996, and/or similar international
|
42 |
+
agreements.
|
43 |
+
|
44 |
+
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
45 |
+
any other exception or limitation to Copyright and Similar Rights
|
46 |
+
that applies to Your use of the Licensed Material.
|
47 |
+
|
48 |
+
f. Licensed Material means the artistic or literary work, database,
|
49 |
+
or other material to which the Licensor applied this Public
|
50 |
+
License.
|
51 |
+
|
52 |
+
g. Licensed Rights means the rights granted to You subject to the
|
53 |
+
terms and conditions of this Public License, which are limited to
|
54 |
+
all Copyright and Similar Rights that apply to Your use of the
|
55 |
+
Licensed Material and that the Licensor has authority to license.
|
56 |
+
|
57 |
+
h. Licensor means the individual(s) or entity(ies) granting rights
|
58 |
+
under this Public License.
|
59 |
+
|
60 |
+
i. NonCommercial means not primarily intended for or directed towards
|
61 |
+
commercial advantage or monetary compensation. For purposes of
|
62 |
+
this Public License, the exchange of the Licensed Material for
|
63 |
+
other material subject to Copyright and Similar Rights by digital
|
64 |
+
file-sharing or similar means is NonCommercial provided there is
|
65 |
+
no payment of monetary compensation in connection with the
|
66 |
+
exchange.
|
67 |
+
|
68 |
+
j. Share means to provide material to the public by any means or
|
69 |
+
process that requires permission under the Licensed Rights, such
|
70 |
+
as reproduction, public display, public performance, distribution,
|
71 |
+
dissemination, communication, or importation, and to make material
|
72 |
+
available to the public including in ways that members of the
|
73 |
+
public may access the material from a place and at a time
|
74 |
+
individually chosen by them.
|
75 |
+
|
76 |
+
k. Sui Generis Database Rights means rights other than copyright
|
77 |
+
resulting from Directive 96/9/EC of the European Parliament and of
|
78 |
+
the Council of 11 March 1996 on the legal protection of databases,
|
79 |
+
as amended and/or succeeded, as well as other essentially
|
80 |
+
equivalent rights anywhere in the world.
|
81 |
+
|
82 |
+
l. You means the individual or entity exercising the Licensed Rights
|
83 |
+
under this Public License. Your has a corresponding meaning.
|
84 |
+
|
85 |
+
|
86 |
+
Section 2 -- Scope.
|
87 |
+
|
88 |
+
a. License grant.
|
89 |
+
|
90 |
+
1. Subject to the terms and conditions of this Public License,
|
91 |
+
the Licensor hereby grants You a worldwide, royalty-free,
|
92 |
+
non-sublicensable, non-exclusive, irrevocable license to
|
93 |
+
exercise the Licensed Rights in the Licensed Material to:
|
94 |
+
|
95 |
+
a. reproduce and Share the Licensed Material, in whole or
|
96 |
+
in part, for NonCommercial purposes only; and
|
97 |
+
|
98 |
+
b. produce, reproduce, and Share Adapted Material for
|
99 |
+
NonCommercial purposes only.
|
100 |
+
|
101 |
+
2. Exceptions and Limitations. For the avoidance of doubt, where
|
102 |
+
Exceptions and Limitations apply to Your use, this Public
|
103 |
+
License does not apply, and You do not need to comply with
|
104 |
+
its terms and conditions.
|
105 |
+
|
106 |
+
3. Term. The term of this Public License is specified in Section
|
107 |
+
6(a).
|
108 |
+
|
109 |
+
4. Media and formats; technical modifications allowed. The
|
110 |
+
Licensor authorizes You to exercise the Licensed Rights in
|
111 |
+
all media and formats whether now known or hereafter created,
|
112 |
+
and to make technical modifications necessary to do so. The
|
113 |
+
Licensor waives and/or agrees not to assert any right or
|
114 |
+
authority to forbid You from making technical modifications
|
115 |
+
necessary to exercise the Licensed Rights, including
|
116 |
+
technical modifications necessary to circumvent Effective
|
117 |
+
Technological Measures. For purposes of this Public License,
|
118 |
+
simply making modifications authorized by this Section 2(a)
|
119 |
+
(4) never produces Adapted Material.
|
120 |
+
|
121 |
+
5. Downstream recipients.
|
122 |
+
|
123 |
+
a. Offer from the Licensor -- Licensed Material. Every
|
124 |
+
recipient of the Licensed Material automatically
|
125 |
+
receives an offer from the Licensor to exercise the
|
126 |
+
Licensed Rights under the terms and conditions of this
|
127 |
+
Public License.
|
128 |
+
|
129 |
+
b. No downstream restrictions. You may not offer or impose
|
130 |
+
any additional or different terms or conditions on, or
|
131 |
+
apply any Effective Technological Measures to, the
|
132 |
+
Licensed Material if doing so restricts exercise of the
|
133 |
+
Licensed Rights by any recipient of the Licensed
|
134 |
+
Material.
|
135 |
+
|
136 |
+
6. No endorsement. Nothing in this Public License constitutes or
|
137 |
+
may be construed as permission to assert or imply that You
|
138 |
+
are, or that Your use of the Licensed Material is, connected
|
139 |
+
with, or sponsored, endorsed, or granted official status by,
|
140 |
+
the Licensor or others designated to receive attribution as
|
141 |
+
provided in Section 3(a)(1)(A)(i).
|
142 |
+
|
143 |
+
b. Other rights.
|
144 |
+
|
145 |
+
1. Moral rights, such as the right of integrity, are not
|
146 |
+
licensed under this Public License, nor are publicity,
|
147 |
+
privacy, and/or other similar personality rights; however, to
|
148 |
+
the extent possible, the Licensor waives and/or agrees not to
|
149 |
+
assert any such rights held by the Licensor to the limited
|
150 |
+
extent necessary to allow You to exercise the Licensed
|
151 |
+
Rights, but not otherwise.
|
152 |
+
|
153 |
+
2. Patent and trademark rights are not licensed under this
|
154 |
+
Public License.
|
155 |
+
|
156 |
+
3. To the extent possible, the Licensor waives any right to
|
157 |
+
collect royalties from You for the exercise of the Licensed
|
158 |
+
Rights, whether directly or through a collecting society
|
159 |
+
under any voluntary or waivable statutory or compulsory
|
160 |
+
licensing scheme. In all other cases the Licensor expressly
|
161 |
+
reserves any right to collect such royalties, including when
|
162 |
+
the Licensed Material is used other than for NonCommercial
|
163 |
+
purposes.
|
164 |
+
|
165 |
+
|
166 |
+
Section 3 -- License Conditions.
|
167 |
+
|
168 |
+
Your exercise of the Licensed Rights is expressly made subject to the
|
169 |
+
following conditions.
|
170 |
+
|
171 |
+
a. Attribution.
|
172 |
+
|
173 |
+
1. If You Share the Licensed Material (including in modified
|
174 |
+
form), You must:
|
175 |
+
|
176 |
+
a. retain the following if it is supplied by the Licensor
|
177 |
+
with the Licensed Material:
|
178 |
+
|
179 |
+
i. identification of the creator(s) of the Licensed
|
180 |
+
Material and any others designated to receive
|
181 |
+
attribution, in any reasonable manner requested by
|
182 |
+
the Licensor (including by pseudonym if
|
183 |
+
designated);
|
184 |
+
|
185 |
+
ii. a copyright notice;
|
186 |
+
|
187 |
+
iii. a notice that refers to this Public License;
|
188 |
+
|
189 |
+
iv. a notice that refers to the disclaimer of
|
190 |
+
warranties;
|
191 |
+
|
192 |
+
v. a URI or hyperlink to the Licensed Material to the
|
193 |
+
extent reasonably practicable;
|
194 |
+
|
195 |
+
b. indicate if You modified the Licensed Material and
|
196 |
+
retain an indication of any previous modifications; and
|
197 |
+
|
198 |
+
c. indicate the Licensed Material is licensed under this
|
199 |
+
Public License, and include the text of, or the URI or
|
200 |
+
hyperlink to, this Public License.
|
201 |
+
|
202 |
+
2. You may satisfy the conditions in Section 3(a)(1) in any
|
203 |
+
reasonable manner based on the medium, means, and context in
|
204 |
+
which You Share the Licensed Material. For example, it may be
|
205 |
+
reasonable to satisfy the conditions by providing a URI or
|
206 |
+
hyperlink to a resource that includes the required
|
207 |
+
information.
|
208 |
+
|
209 |
+
3. If requested by the Licensor, You must remove any of the
|
210 |
+
information required by Section 3(a)(1)(A) to the extent
|
211 |
+
reasonably practicable.
|
212 |
+
|
213 |
+
4. If You Share Adapted Material You produce, the Adapter's
|
214 |
+
License You apply must not prevent recipients of the Adapted
|
215 |
+
Material from complying with this Public License.
|
216 |
+
|
217 |
+
|
218 |
+
Section 4 -- Sui Generis Database Rights.
|
219 |
+
|
220 |
+
Where the Licensed Rights include Sui Generis Database Rights that
|
221 |
+
apply to Your use of the Licensed Material:
|
222 |
+
|
223 |
+
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
224 |
+
to extract, reuse, reproduce, and Share all or a substantial
|
225 |
+
portion of the contents of the database for NonCommercial purposes
|
226 |
+
only;
|
227 |
+
|
228 |
+
b. if You include all or a substantial portion of the database
|
229 |
+
contents in a database in which You have Sui Generis Database
|
230 |
+
Rights, then the database in which You have Sui Generis Database
|
231 |
+
Rights (but not its individual contents) is Adapted Material; and
|
232 |
+
|
233 |
+
c. You must comply with the conditions in Section 3(a) if You Share
|
234 |
+
all or a substantial portion of the contents of the database.
|
235 |
+
|
236 |
+
For the avoidance of doubt, this Section 4 supplements and does not
|
237 |
+
replace Your obligations under this Public License where the Licensed
|
238 |
+
Rights include other Copyright and Similar Rights.
|
239 |
+
|
240 |
+
|
241 |
+
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
242 |
+
|
243 |
+
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
244 |
+
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
245 |
+
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
246 |
+
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
247 |
+
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
248 |
+
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
249 |
+
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
250 |
+
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
251 |
+
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
252 |
+
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
253 |
+
|
254 |
+
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
255 |
+
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
256 |
+
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
257 |
+
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
258 |
+
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
259 |
+
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
260 |
+
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
261 |
+
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
262 |
+
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
263 |
+
|
264 |
+
c. The disclaimer of warranties and limitation of liability provided
|
265 |
+
above shall be interpreted in a manner that, to the extent
|
266 |
+
possible, most closely approximates an absolute disclaimer and
|
267 |
+
waiver of all liability.
|
268 |
+
|
269 |
+
|
270 |
+
Section 6 -- Term and Termination.
|
271 |
+
|
272 |
+
a. This Public License applies for the term of the Copyright and
|
273 |
+
Similar Rights licensed here. However, if You fail to comply with
|
274 |
+
this Public License, then Your rights under this Public License
|
275 |
+
terminate automatically.
|
276 |
+
|
277 |
+
b. Where Your right to use the Licensed Material has terminated under
|
278 |
+
Section 6(a), it reinstates:
|
279 |
+
|
280 |
+
1. automatically as of the date the violation is cured, provided
|
281 |
+
it is cured within 30 days of Your discovery of the
|
282 |
+
violation; or
|
283 |
+
|
284 |
+
2. upon express reinstatement by the Licensor.
|
285 |
+
|
286 |
+
For the avoidance of doubt, this Section 6(b) does not affect any
|
287 |
+
right the Licensor may have to seek remedies for Your violations
|
288 |
+
of this Public License.
|
289 |
+
|
290 |
+
c. For the avoidance of doubt, the Licensor may also offer the
|
291 |
+
Licensed Material under separate terms or conditions or stop
|
292 |
+
distributing the Licensed Material at any time; however, doing so
|
293 |
+
will not terminate this Public License.
|
294 |
+
|
295 |
+
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
296 |
+
License.
|
297 |
+
|
298 |
+
|
299 |
+
Section 7 -- Other Terms and Conditions.
|
300 |
+
|
301 |
+
a. The Licensor shall not be bound by any additional or different
|
302 |
+
terms or conditions communicated by You unless expressly agreed.
|
303 |
+
|
304 |
+
b. Any arrangements, understandings, or agreements regarding the
|
305 |
+
Licensed Material not stated herein are separate from and
|
306 |
+
independent of the terms and conditions of this Public License.
|
307 |
+
|
308 |
+
|
309 |
+
Section 8 -- Interpretation.
|
310 |
+
|
311 |
+
a. For the avoidance of doubt, this Public License does not, and
|
312 |
+
shall not be interpreted to, reduce, limit, restrict, or impose
|
313 |
+
conditions on any use of the Licensed Material that could lawfully
|
314 |
+
be made without permission under this Public License.
|
315 |
+
|
316 |
+
b. To the extent possible, if any provision of this Public License is
|
317 |
+
deemed unenforceable, it shall be automatically reformed to the
|
318 |
+
minimum extent necessary to make it enforceable. If the provision
|
319 |
+
cannot be reformed, it shall be severed from this Public License
|
320 |
+
without affecting the enforceability of the remaining terms and
|
321 |
+
conditions.
|
322 |
+
|
323 |
+
c. No term or condition of this Public License will be waived and no
|
324 |
+
failure to comply consented to unless expressly agreed to by the
|
325 |
+
Licensor.
|
326 |
+
|
327 |
+
d. Nothing in this Public License constitutes or may be interpreted
|
328 |
+
as a limitation upon, or waiver of, any privileges and immunities
|
329 |
+
that apply to the Licensor or You, including from the legal
|
330 |
+
processes of any jurisdiction or authority.
|
331 |
+
|
332 |
+
=======================================================================
|
README.md
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: OpenVoice
|
3 |
+
emoji: 🤗
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.48.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
+
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 |
+
import os
|
2 |
+
import gradio as gr
|
3 |
+
import requests
|
4 |
+
import langid
|
5 |
+
import base64
|
6 |
+
import json
|
7 |
+
import time
|
8 |
+
|
9 |
+
API_URL = os.environ.get("API_URL")
|
10 |
+
supported_languages = ['zh', 'en']
|
11 |
+
|
12 |
+
output_dir = 'outputs'
|
13 |
+
os.makedirs(output_dir, exist_ok=True)
|
14 |
+
|
15 |
+
def audio_to_base64(audio_file):
|
16 |
+
with open(audio_file, "rb") as audio_file:
|
17 |
+
audio_data = audio_file.read()
|
18 |
+
base64_data = base64.b64encode(audio_data).decode("utf-8")
|
19 |
+
return base64_data
|
20 |
+
|
21 |
+
def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, agree):
|
22 |
+
# initialize a empty info
|
23 |
+
text_hint = ''
|
24 |
+
# agree with the terms
|
25 |
+
if agree == False:
|
26 |
+
text_hint += '[ERROR] Please accept the Terms & Condition!\n'
|
27 |
+
gr.Warning("Please accept the Terms & Condition!")
|
28 |
+
return (
|
29 |
+
text_hint,
|
30 |
+
None,
|
31 |
+
None,
|
32 |
+
)
|
33 |
+
|
34 |
+
# first detect the input language
|
35 |
+
language_predicted = langid.classify(prompt)[0].strip()
|
36 |
+
print(f"Detected language:{language_predicted}")
|
37 |
+
|
38 |
+
|
39 |
+
if language_predicted not in supported_languages:
|
40 |
+
text_hint += f"[ERROR] The detected language {language_predicted} for your input text is not in our Supported Languages: {supported_languages}\n"
|
41 |
+
gr.Warning(
|
42 |
+
f"The detected language {language_predicted} for your input text is not in our Supported Languages: {supported_languages}"
|
43 |
+
)
|
44 |
+
|
45 |
+
return (
|
46 |
+
text_hint,
|
47 |
+
None,
|
48 |
+
None,
|
49 |
+
)
|
50 |
+
|
51 |
+
if language_predicted == "zh":
|
52 |
+
if style not in ['default']:
|
53 |
+
text_hint += f"[ERROR] The style {style} is not supported for Chinese, which should be in ['default']\n"
|
54 |
+
gr.Warning(f"The style {style} is not supported for Chinese, which should be in ['default']")
|
55 |
+
return (
|
56 |
+
text_hint,
|
57 |
+
None,
|
58 |
+
None,
|
59 |
+
)
|
60 |
+
style = 'cn_' + style
|
61 |
+
|
62 |
+
else:
|
63 |
+
if style not in ['default', 'whispering', 'shouting', 'excited', 'cheerful', 'terrified', 'angry', 'sad', 'friendly']:
|
64 |
+
text_hint += f"[ERROR] The style {style} is not supported for English, which should be in ['default', 'whispering', 'shouting', 'excited', 'cheerful', 'terrified', 'angry', 'sad', 'friendly']\n"
|
65 |
+
gr.Warning(f"The style {style} is not supported for English, which should be in ['default', 'whispering', 'shouting', 'excited', 'cheerful', 'terrified', 'angry', 'sad', 'friendly']")
|
66 |
+
return (
|
67 |
+
text_hint,
|
68 |
+
None,
|
69 |
+
None,
|
70 |
+
)
|
71 |
+
style = 'en_' + style
|
72 |
+
|
73 |
+
|
74 |
+
if use_mic == True:
|
75 |
+
if mic_file_path is not None:
|
76 |
+
speaker_wav = mic_file_path
|
77 |
+
else:
|
78 |
+
text_hint += f"[ERROR] Please record your voice with Microphone, or uncheck Use Microphone to use reference audios\n"
|
79 |
+
gr.Warning(
|
80 |
+
"Please record your voice with Microphone, or uncheck Use Microphone to use reference audios"
|
81 |
+
)
|
82 |
+
return (
|
83 |
+
text_hint,
|
84 |
+
None,
|
85 |
+
None,
|
86 |
+
)
|
87 |
+
|
88 |
+
else:
|
89 |
+
speaker_wav = audio_file_pth
|
90 |
+
|
91 |
+
if len(prompt) < 2:
|
92 |
+
text_hint += f"[ERROR] Please give a longer prompt text \n"
|
93 |
+
gr.Warning("Please give a longer prompt text")
|
94 |
+
return (
|
95 |
+
text_hint,
|
96 |
+
None,
|
97 |
+
None,
|
98 |
+
)
|
99 |
+
if len(prompt) > 200:
|
100 |
+
text_hint += f"[ERROR] Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo and try for your usage \n"
|
101 |
+
gr.Warning(
|
102 |
+
"Text length limited to 200 characters for this demo, please try shorter text. You can clone our open-source repo for your usage"
|
103 |
+
)
|
104 |
+
return (
|
105 |
+
text_hint,
|
106 |
+
None,
|
107 |
+
None,
|
108 |
+
)
|
109 |
+
|
110 |
+
save_path = f'{output_dir}/output.wav'
|
111 |
+
speaker_audio_base64 = audio_to_base64(speaker_wav)
|
112 |
+
data = {
|
113 |
+
"text": prompt,
|
114 |
+
"reference_speaker": speaker_audio_base64,
|
115 |
+
"emotion": style
|
116 |
+
}
|
117 |
+
|
118 |
+
start = time.time()
|
119 |
+
# Send the data as a POST request
|
120 |
+
response = requests.post(API_URL, json=data)
|
121 |
+
print(f'Get response successfully within {time.time() - start}')
|
122 |
+
|
123 |
+
# Check the response
|
124 |
+
if response.status_code == 200:
|
125 |
+
try:
|
126 |
+
json_data = json.loads(response.content)
|
127 |
+
text_hint += f"[ERROR] {json_data['error']} \n"
|
128 |
+
gr.Warning(
|
129 |
+
f"[ERROR] {json_data['error']} \n"
|
130 |
+
)
|
131 |
+
return (
|
132 |
+
text_hint,
|
133 |
+
None,
|
134 |
+
None,
|
135 |
+
)
|
136 |
+
except:
|
137 |
+
with open(save_path, 'wb') as f:
|
138 |
+
f.write(response.content)
|
139 |
+
else:
|
140 |
+
text_hint += f"[HTTP ERROR] {response.status_code} - {response.text} \n"
|
141 |
+
gr.Warning(
|
142 |
+
f"[HTTP ERROR] {response.status_code} - {response.text} \n"
|
143 |
+
)
|
144 |
+
return (
|
145 |
+
text_hint,
|
146 |
+
None,
|
147 |
+
None,
|
148 |
+
)
|
149 |
+
text_hint += f'''Get response successfully \n'''
|
150 |
+
return (
|
151 |
+
text_hint,
|
152 |
+
save_path,
|
153 |
+
speaker_wav,
|
154 |
+
)
|
155 |
+
|
156 |
+
|
157 |
+
title = "MyShell OpenVoice"
|
158 |
+
|
159 |
+
description = """
|
160 |
+
We introduce OpenVoice, a versatile instant voice cloning approach that requires only a short audio clip from the reference speaker to replicate their voice and generate speech in multiple languages. OpenVoice enables granular control over voice styles, including emotion, accent, rhythm, pauses, and intonation, in addition to replicating the tone color of the reference speaker. OpenVoice also achieves zero-shot cross-lingual voice cloning for languages not included in the massive-speaker training set.
|
161 |
+
"""
|
162 |
+
|
163 |
+
markdown_table = """
|
164 |
+
<div align="center" style="margin-bottom: 10px;">
|
165 |
+
|
166 |
+
| | | |
|
167 |
+
| :-----------: | :-----------: | :-----------: |
|
168 |
+
| **OpenSource Repo** | **Project Page** | **Join the Community** |
|
169 |
+
| <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | [OpenVoice](https://research.myshell.ai/open-voice) | [](https://discord.gg/myshell) |
|
170 |
+
|
171 |
+
</div>
|
172 |
+
"""
|
173 |
+
|
174 |
+
markdown_table_v2 = """
|
175 |
+
<div align="center" style="margin-bottom: 2px;">
|
176 |
+
|
177 |
+
| | | | |
|
178 |
+
| :-----------: | :-----------: | :-----------: | :-----------: |
|
179 |
+
| **OpenSource Repo** | <div style='text-align: center;'><a style="display:inline-block,align:center" href='https://github.com/myshell-ai/OpenVoice'><img src='https://img.shields.io/github/stars/myshell-ai/OpenVoice?style=social' /></a></div> | **Project Page** | [OpenVoice](https://research.myshell.ai/open-voice) |
|
180 |
+
|
181 |
+
| | |
|
182 |
+
| :-----------: | :-----------: |
|
183 |
+
**Join the Community** | [](https://discord.gg/myshell) |
|
184 |
+
|
185 |
+
</div>
|
186 |
+
"""
|
187 |
+
content = """
|
188 |
+
<div>
|
189 |
+
<strong>For multi-lingual & cross-lingual examples, please refer to <a href='https://github.com/myshell-ai/OpenVoice/blob/main/demo_part2.ipynb'>this jupyter notebook</a>.</strong>
|
190 |
+
This online demo mainly supports <strong>English</strong>. The <em>default</em> style also supports <strong>Chinese</strong>. But OpenVoice can adapt to any other language as long as a base speaker is provided.
|
191 |
+
</div>
|
192 |
+
"""
|
193 |
+
wrapped_markdown_content = f"<div style='border: 1px solid #000; padding: 10px;'>{content}</div>"
|
194 |
+
|
195 |
+
|
196 |
+
examples = [
|
197 |
+
[
|
198 |
+
"今天天气真好,我们一起出去吃饭吧。",
|
199 |
+
'default',
|
200 |
+
"examples/speaker0.mp3",
|
201 |
+
None,
|
202 |
+
False,
|
203 |
+
True,
|
204 |
+
],[
|
205 |
+
"This audio is generated by open voice with a half-performance model.",
|
206 |
+
'whispering',
|
207 |
+
"examples/speaker1.mp3",
|
208 |
+
None,
|
209 |
+
False,
|
210 |
+
True,
|
211 |
+
],
|
212 |
+
[
|
213 |
+
"He hoped there would be stew for dinner, turnips and carrots and bruised potatoes and fat mutton pieces to be ladled out in thick, peppered, flour-fattened sauce.",
|
214 |
+
'sad',
|
215 |
+
"examples/speaker2.mp3",
|
216 |
+
None,
|
217 |
+
False,
|
218 |
+
True,
|
219 |
+
],
|
220 |
+
]
|
221 |
+
|
222 |
+
with gr.Blocks(analytics_enabled=False) as demo:
|
223 |
+
|
224 |
+
with gr.Row():
|
225 |
+
with gr.Column():
|
226 |
+
with gr.Row():
|
227 |
+
gr.Markdown(
|
228 |
+
"""
|
229 |
+
## <img src="https://huggingface.co/spaces/myshell-ai/OpenVoice/raw/main/logo.jpg" height="40"/>
|
230 |
+
"""
|
231 |
+
)
|
232 |
+
with gr.Row():
|
233 |
+
gr.Markdown(markdown_table_v2)
|
234 |
+
with gr.Row():
|
235 |
+
gr.Markdown(description)
|
236 |
+
with gr.Column():
|
237 |
+
gr.Video('./open_voice.mp4', autoplay=True)
|
238 |
+
|
239 |
+
with gr.Row():
|
240 |
+
gr.HTML(wrapped_markdown_content)
|
241 |
+
|
242 |
+
with gr.Row():
|
243 |
+
with gr.Column():
|
244 |
+
input_text_gr = gr.Textbox(
|
245 |
+
label="Text Prompt",
|
246 |
+
info="One or two sentences at a time is better. Up to 200 text characters.",
|
247 |
+
value="He hoped there would be stew for dinner, turnips and carrots and bruised potatoes and fat mutton pieces to be ladled out in thick, peppered, flour-fattened sauce.",
|
248 |
+
)
|
249 |
+
style_gr = gr.Dropdown(
|
250 |
+
label="Style",
|
251 |
+
info="Select a style of output audio for the synthesised speech. (Chinese only support 'default' now)",
|
252 |
+
choices=['default', 'whispering', 'cheerful', 'terrified', 'angry', 'sad', 'friendly'],
|
253 |
+
max_choices=1,
|
254 |
+
value="default",
|
255 |
+
)
|
256 |
+
ref_gr = gr.Audio(
|
257 |
+
label="Reference Audio",
|
258 |
+
info="Click on the ✎ button to upload your own target speaker audio",
|
259 |
+
type="filepath",
|
260 |
+
value="examples/speaker0.mp3",
|
261 |
+
)
|
262 |
+
mic_gr = gr.Audio(
|
263 |
+
source="microphone",
|
264 |
+
type="filepath",
|
265 |
+
info="Use your microphone to record audio",
|
266 |
+
label="Use Microphone for Reference",
|
267 |
+
)
|
268 |
+
use_mic_gr = gr.Checkbox(
|
269 |
+
label="Use Microphone",
|
270 |
+
value=False,
|
271 |
+
info="Notice: Microphone input may not work properly under traffic",
|
272 |
+
)
|
273 |
+
tos_gr = gr.Checkbox(
|
274 |
+
label="Agree",
|
275 |
+
value=False,
|
276 |
+
info="I agree to the terms of the cc-by-nc-4.0 license-: https://github.com/myshell-ai/OpenVoice/blob/main/LICENSE",
|
277 |
+
)
|
278 |
+
|
279 |
+
tts_button = gr.Button("Send", elem_id="send-btn", visible=True)
|
280 |
+
|
281 |
+
|
282 |
+
with gr.Column():
|
283 |
+
out_text_gr = gr.Text(label="Info")
|
284 |
+
audio_gr = gr.Audio(label="Synthesised Audio", autoplay=True)
|
285 |
+
ref_audio_gr = gr.Audio(label="Reference Audio Used")
|
286 |
+
|
287 |
+
gr.Examples(examples,
|
288 |
+
label="Examples",
|
289 |
+
inputs=[input_text_gr, style_gr, ref_gr, mic_gr, use_mic_gr, tos_gr],
|
290 |
+
outputs=[out_text_gr, audio_gr, ref_audio_gr],
|
291 |
+
fn=predict,
|
292 |
+
cache_examples=False,)
|
293 |
+
tts_button.click(predict, [input_text_gr, style_gr, ref_gr, mic_gr, use_mic_gr, tos_gr], outputs=[out_text_gr, audio_gr, ref_audio_gr])
|
294 |
+
|
295 |
+
demo.queue()
|
296 |
+
demo.launch(debug=True, show_api=True)
|
examples/speaker0.mp3
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6e8a024342499eee94e81cd4c5b18c541c04263dc1865fc3f9a134fe3b135e00
|
3 |
+
size 308503
|
examples/speaker1.mp3
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:beae7e33f1e7bc21c34d1401947b6c10352a817816a3151ff1efb82133585e24
|
3 |
+
size 729355
|
examples/speaker2.mp3
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8190e911f82c4b06fde63c55a5599b40ba652950eed704cf2cb54d477cf33978
|
3 |
+
size 471925
|
logo.jpg
ADDED
![]() |
open_voice.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5a76fa34a6443966bb383d381fe1914db014e9d2c1693f7be858281a1b9da7eb
|
3 |
+
size 7677295
|
packages.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
unzip
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
langid
|