Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- .gradio/certificate.pem +31 -0
- README.md +13 -7
- __pycache__/gradio.cpython-310.pyc +0 -0
- audio.wav +0 -0
- gr-demo.py +12 -0
- gradio-audio.py +61 -0
- kokoro-v0_19.onnx +3 -0
- requirements.txt +119 -0
- voices.json +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
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 |
+
voices.json filter=lfs diff=lfs merge=lfs -text
|
.gradio/certificate.pem
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-----BEGIN CERTIFICATE-----
|
2 |
+
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
|
3 |
+
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
4 |
+
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
|
5 |
+
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
|
6 |
+
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
|
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QDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ
|
22 |
+
3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK
|
23 |
+
NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5
|
24 |
+
ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
|
25 |
+
TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
|
26 |
+
jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
|
27 |
+
oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
|
28 |
+
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
|
29 |
+
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
|
30 |
+
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
|
31 |
+
-----END CERTIFICATE-----
|
README.md
CHANGED
@@ -1,12 +1,18 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.12.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Kokoro_onnx
|
3 |
+
app_file: gradio-audio.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
sdk_version: 5.12.0
|
|
|
|
|
6 |
---
|
7 |
+
# kokoro-tts
|
8 |
+
Gradio Demo of kokoro tts
|
9 |
|
10 |
+
Download files from https://github.com/thewh1teagle/kokoro-onnx/tree/main
|
11 |
+
|
12 |
+
You need kokoro-v0_19.onnx and voices.json
|
13 |
+
|
14 |
+
# How to run
|
15 |
+
```
|
16 |
+
pip install -r requirements.txt
|
17 |
+
python gradio_audio.py
|
18 |
+
```
|
__pycache__/gradio.cpython-310.pyc
ADDED
Binary file (2.04 kB). View file
|
|
audio.wav
ADDED
Binary file (262 kB). View file
|
|
gr-demo.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(name, intensity):
|
4 |
+
return "Hello, " + name + "!" * int(intensity)
|
5 |
+
|
6 |
+
demo = gr.Interface(
|
7 |
+
fn=greet,
|
8 |
+
inputs=["text", "slider"],
|
9 |
+
outputs=["text"],
|
10 |
+
)
|
11 |
+
|
12 |
+
demo.launch()
|
gradio-audio.py
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from kokoro_onnx import Kokoro
|
3 |
+
import soundfile as sf
|
4 |
+
import tempfile
|
5 |
+
import os
|
6 |
+
|
7 |
+
class TextToSpeechApp:
|
8 |
+
def __init__(self):
|
9 |
+
# Initialize Kokoro
|
10 |
+
self.kokoro = Kokoro("kokoro-v0_19.onnx", "voices.json")
|
11 |
+
|
12 |
+
# Available voices
|
13 |
+
self.voices = [
|
14 |
+
'af', 'af_bella', 'af_nicole', 'af_sarah', 'af_sky',
|
15 |
+
'am_adam', 'am_michael', 'bf_emma', 'bf_isabella',
|
16 |
+
'bm_george', 'bm_lewis'
|
17 |
+
]
|
18 |
+
|
19 |
+
def generate_speech(self, text, voice, speed):
|
20 |
+
try:
|
21 |
+
# Generate audio
|
22 |
+
samples, sample_rate = self.kokoro.create(
|
23 |
+
text,
|
24 |
+
voice=voice,
|
25 |
+
speed=float(speed)
|
26 |
+
)
|
27 |
+
|
28 |
+
# Create temporary file
|
29 |
+
temp_dir = tempfile.mkdtemp()
|
30 |
+
temp_path = os.path.join(temp_dir, "output.wav")
|
31 |
+
|
32 |
+
# Save to temporary file
|
33 |
+
sf.write(temp_path, samples, sample_rate)
|
34 |
+
|
35 |
+
return temp_path
|
36 |
+
|
37 |
+
except Exception as e:
|
38 |
+
return f"Error: {str(e)}"
|
39 |
+
|
40 |
+
def create_interface(self):
|
41 |
+
interface = gr.Interface(
|
42 |
+
fn=self.generate_speech,
|
43 |
+
inputs=[
|
44 |
+
gr.Textbox(label="Enter text to convert", lines=5),
|
45 |
+
gr.Dropdown(choices=self.voices, label="Select Voice", value=self.voices[0]),
|
46 |
+
gr.Slider(minimum=0.5, maximum=2.0, value=1.0, step=0.1, label="Speech Speed")
|
47 |
+
],
|
48 |
+
outputs=gr.Audio(label="Generated Speech"),
|
49 |
+
title="Text to Speech Converter",
|
50 |
+
description="Convert text to speech using different voices and speeds."
|
51 |
+
)
|
52 |
+
return interface
|
53 |
+
|
54 |
+
def main():
|
55 |
+
app = TextToSpeechApp()
|
56 |
+
interface = app.create_interface()
|
57 |
+
# Launch with a public URL
|
58 |
+
interface.launch(server_name="0.0.0.0", share=True)
|
59 |
+
|
60 |
+
if __name__ == "__main__":
|
61 |
+
main()
|
kokoro-v0_19.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ebef42457f7efee9b60b4f1d5aec7692f2925923948a0d7a2a49d2c9edf57e49
|
3 |
+
size 345554732
|
requirements.txt
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.2.1
|
2 |
+
altair==5.5.0
|
3 |
+
annotated-types==0.7.0
|
4 |
+
anyio==4.8.0
|
5 |
+
attrs==24.3.0
|
6 |
+
audioread==3.0.1
|
7 |
+
babel==2.16.0
|
8 |
+
bibtexparser==2.0.0b8
|
9 |
+
certifi==2024.12.14
|
10 |
+
cffi==1.17.1
|
11 |
+
charset-normalizer==3.4.1
|
12 |
+
click==8.1.8
|
13 |
+
clldutils==3.24.0
|
14 |
+
colorama==0.4.6
|
15 |
+
coloredlogs==15.0.1
|
16 |
+
colorlog==6.9.0
|
17 |
+
contourpy==1.3.1
|
18 |
+
csvw==3.5.1
|
19 |
+
cycler==0.12.1
|
20 |
+
decorator==5.1.1
|
21 |
+
dlinfo==1.2.1
|
22 |
+
espeakng-loader==0.2.1
|
23 |
+
exceptiongroup==1.2.2
|
24 |
+
fastapi==0.115.6
|
25 |
+
ffmpy==0.5.0
|
26 |
+
filelock==3.16.1
|
27 |
+
flatbuffers==24.12.23
|
28 |
+
fonttools==4.55.3
|
29 |
+
fsspec==2024.12.0
|
30 |
+
gradio==5.12.0
|
31 |
+
gradio_client==1.5.4
|
32 |
+
h11==0.14.0
|
33 |
+
httpcore==1.0.7
|
34 |
+
httpx==0.28.1
|
35 |
+
huggingface-hub==0.27.1
|
36 |
+
humanfriendly==10.0
|
37 |
+
idna==3.10
|
38 |
+
importlib_resources==6.5.2
|
39 |
+
isodate==0.7.2
|
40 |
+
Jinja2==3.1.5
|
41 |
+
joblib==1.4.2
|
42 |
+
jsonschema==4.23.0
|
43 |
+
jsonschema-specifications==2024.10.1
|
44 |
+
kiwisolver==1.4.8
|
45 |
+
kokoro-onnx==0.2.5
|
46 |
+
language-tags==1.2.0
|
47 |
+
lazy_loader==0.4
|
48 |
+
librosa==0.10.2.post1
|
49 |
+
llvmlite==0.43.0
|
50 |
+
lxml==5.3.0
|
51 |
+
Markdown==3.7
|
52 |
+
markdown-it-py==3.0.0
|
53 |
+
MarkupSafe==2.1.5
|
54 |
+
matplotlib==3.10.0
|
55 |
+
mdurl==0.1.2
|
56 |
+
mpmath==1.3.0
|
57 |
+
msgpack==1.1.0
|
58 |
+
munch==4.0.0
|
59 |
+
narwhals==1.21.1
|
60 |
+
networkx==3.4.2
|
61 |
+
numba==0.60.0
|
62 |
+
numpy==1.26.4
|
63 |
+
onnxruntime==1.20.1
|
64 |
+
orjson==3.10.14
|
65 |
+
packaging==24.2
|
66 |
+
pandas==2.2.3
|
67 |
+
phonemizer==3.3.0
|
68 |
+
phonemizer-fork==3.3.1
|
69 |
+
pillow==10.4.0
|
70 |
+
platformdirs==4.3.6
|
71 |
+
pooch==1.8.2
|
72 |
+
protobuf==5.29.3
|
73 |
+
pycparser==2.22
|
74 |
+
pydantic==2.10.5
|
75 |
+
pydantic_core==2.27.2
|
76 |
+
pydub==0.25.1
|
77 |
+
Pygments==2.19.1
|
78 |
+
pylatexenc==2.10
|
79 |
+
pyparsing==3.2.1
|
80 |
+
python-dateutil==2.9.0.post0
|
81 |
+
python-multipart==0.0.20
|
82 |
+
pytz==2024.2
|
83 |
+
PyYAML==6.0.2
|
84 |
+
rdflib==7.1.2
|
85 |
+
referencing==0.35.1
|
86 |
+
regex==2024.11.6
|
87 |
+
requests==2.32.3
|
88 |
+
rfc3986==1.5.0
|
89 |
+
rich==13.9.4
|
90 |
+
rpds-py==0.22.3
|
91 |
+
ruff==0.9.1
|
92 |
+
safehttpx==0.1.6
|
93 |
+
safetensors==0.5.2
|
94 |
+
scikit-learn==1.6.1
|
95 |
+
scipy==1.15.1
|
96 |
+
segments==2.2.1
|
97 |
+
semantic-version==2.10.0
|
98 |
+
shellingham==1.5.4
|
99 |
+
six==1.17.0
|
100 |
+
sniffio==1.3.1
|
101 |
+
sounddevice==0.5.1
|
102 |
+
soundfile==0.13.0
|
103 |
+
soxr==0.5.0.post1
|
104 |
+
starlette==0.41.3
|
105 |
+
sympy==1.13.1
|
106 |
+
tabulate==0.9.0
|
107 |
+
threadpoolctl==3.5.0
|
108 |
+
tokenizers==0.21.0
|
109 |
+
tomlkit==0.12.0
|
110 |
+
torch==2.5.1
|
111 |
+
tqdm==4.67.1
|
112 |
+
transformers==4.48.0
|
113 |
+
typer==0.15.1
|
114 |
+
typing_extensions==4.12.2
|
115 |
+
tzdata==2024.2
|
116 |
+
uritemplate==4.1.1
|
117 |
+
urllib3==2.3.0
|
118 |
+
uvicorn==0.34.0
|
119 |
+
websockets==11.0.3
|
voices.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc24670e8333cb30990726c5d99e991afc14645139d1a9d2d1858d4fba08df05
|
3 |
+
size 54060439
|