prince-canuma commited on
Commit
c19ac49
ยท
verified ยท
1 Parent(s): fcf78bf

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -132
README.md CHANGED
@@ -6,138 +6,15 @@ base_model:
6
  - yl4579/StyleTTS2-LJSpeech
7
  pipeline_tag: text-to-speech
8
  ---
9
- **Kokoro** is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, Kokoro can be deployed anywhere from production environments to personal projects.
 
 
 
10
 
11
- <audio controls><source src="https://huggingface.co/hexgrad/Kokoro-82M/resolve/main/samples/HEARME.wav" type="audio/wav"></audio>
12
-
13
- โฌ†๏ธ **Kokoro has been upgraded to v1.0!** See [Releases](https://huggingface.co/hexgrad/Kokoro-82M#releases).
14
-
15
- โœจ You can now [`pip install kokoro`](https://github.com/hexgrad/kokoro)! See [Usage](https://huggingface.co/hexgrad/Kokoro-82M#usage).
16
-
17
- - [Releases](#releases)
18
- - [Usage](#usage)
19
- - [SAMPLES.md](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/SAMPLES.md) โ†—๏ธ
20
- - [VOICES.md](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md) โ†—๏ธ
21
- - [Model Facts](#model-facts)
22
- - [Training Details](#training-details)
23
- - [Creative Commons Attribution](#creative-commons-attribution)
24
- - [Acknowledgements](#acknowledgements)
25
-
26
- ### Releases
27
-
28
- | Model | Published | Training Data | Langs & Voices | SHA256 |
29
- | ----- | --------- | ------------- | -------------- | ------ |
30
- | [v0.19](https://huggingface.co/hexgrad/kLegacy/tree/main/v0.19) | 2024 Dec 25 | <100 hrs | 1 & 10 | `3b0c392f` |
31
- | **v1.0** | **2025 Jan 27** | **Few hundred hrs** | [**8 & 54**](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md) | `496dba11` |
32
-
33
- | Training Costs | v0.19 | v1.0 | **Total** |
34
- | -------------- | ----- | ---- | ----- |
35
- | in A100 80GB GPU hours | 500 | 500 | **1000** |
36
- | average hourly rate | $0.80/h | $1.20/h | **$1/h** |
37
- | in USD | $400 | $600 | **$1000** |
38
-
39
- ### Usage
40
-
41
- [`pip install kokoro`](https://pypi.org/project/kokoro/) installs the inference library at https://github.com/hexgrad/kokoro
42
-
43
- You can run this cell on [Google Colab](https://colab.research.google.com/). [Listen to samples](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/SAMPLES.md).
44
- ```py
45
- # 1๏ธโƒฃ Install kokoro
46
- !pip install -q kokoro>=0.3.4 soundfile
47
- # 2๏ธโƒฃ Install espeak, used for English OOD fallback and some non-English languages
48
- !apt-get -qq -y install espeak-ng > /dev/null 2>&1
49
- # ๐Ÿ‡ช๐Ÿ‡ธ 'e' => Spanish es
50
- # ๐Ÿ‡ซ๐Ÿ‡ท 'f' => French fr-fr
51
- # ๐Ÿ‡ฎ๐Ÿ‡ณ 'h' => Hindi hi
52
- # ๐Ÿ‡ฎ๐Ÿ‡น 'i' => Italian it
53
- # ๐Ÿ‡ง๐Ÿ‡ท 'p' => Brazilian Portuguese pt-br
54
-
55
- # 3๏ธโƒฃ Initalize a pipeline
56
- from kokoro import KPipeline
57
- from IPython.display import display, Audio
58
- import soundfile as sf
59
- # ๐Ÿ‡บ๐Ÿ‡ธ 'a' => American English, ๐Ÿ‡ฌ๐Ÿ‡ง 'b' => British English
60
- # ๐Ÿ‡ฏ๐Ÿ‡ต 'j' => Japanese: pip install misaki[ja]
61
- # ๐Ÿ‡จ๐Ÿ‡ณ 'z' => Mandarin Chinese: pip install misaki[zh]
62
- pipeline = KPipeline(lang_code='a') # <= make sure lang_code matches voice
63
-
64
- # This text is for demonstration purposes only, unseen during training
65
- text = '''
66
- The sky above the port was the color of television, tuned to a dead channel.
67
- "It's not like I'm using," Case heard someone say, as he shouldered his way through the crowd around the door of the Chat. "It's like my body's developed this massive drug deficiency."
68
- It was a Sprawl voice and a Sprawl joke. The Chatsubo was a bar for professional expatriates; you could drink there for a week and never hear two words in Japanese.
69
-
70
- These were to have an enormous impact, not only because they were associated with Constantine, but also because, as in so many other areas, the decisions taken by Constantine (or in his name) were to have great significance for centuries to come. One of the main issues was the shape that Christian churches were to take, since there was not, apparently, a tradition of monumental church buildings when Constantine decided to help the Christian church build a series of truly spectacular structures. The main form that these churches took was that of the basilica, a multipurpose rectangular structure, based ultimately on the earlier Greek stoa, which could be found in most of the great cities of the empire. Christianity, unlike classical polytheism, needed a large interior space for the celebration of its religious services, and the basilica aptly filled that need. We naturally do not know the degree to which the emperor was involved in the design of new churches, but it is tempting to connect this with the secular basilica that Constantine completed in the Roman forum (the so-called Basilica of Maxentius) and the one he probably built in Trier, in connection with his residence in the city at a time when he was still caesar.
71
-
72
- [Kokoro](/kหˆOkษ™ษนO/) is an open-weight TTS model with 82 million parameters. Despite its lightweight architecture, it delivers comparable quality to larger models while being significantly faster and more cost-efficient. With Apache-licensed weights, [Kokoro](/kหˆOkษ™ษนO/) can be deployed anywhere from production environments to personal projects.
73
- '''
74
- # text = 'ใ€Œใ‚‚ใ—ใŠใ‚ŒใŒใŸใ ๅถ็„ถใ€ใใ—ใฆใ“ใ†ใ—ใ‚ˆใ†ใจใ„ใ†ใคใ‚‚ใ‚Šใงใชใใ“ใ“ใซ็ซ‹ใฃใฆใ„ใ‚‹ใฎใชใ‚‰ใ€ใกใ‚‡ใฃใจใฐใ‹ใ‚Š็ตถๆœ›ใ™ใ‚‹ใจใ“ใ‚ใ ใชใ€ใจใ€ใใ‚“ใชใ“ใจใŒๅฝผใฎ้ ญใซๆ€ใ„ๆตฎใ‹ใ‚“ใ ใ€‚'
75
- # text = 'ไธญๅœ‹ไบบๆฐ‘ไธไฟก้‚ชไนŸไธๆ€•้‚ช๏ผŒไธๆƒนไบ‹ไนŸไธๆ€•ไบ‹๏ผŒไปปไฝ•ๅค–ๅœ‹ไธ่ฆๆŒ‡ๆœ›ๆˆ‘ๅ€‘ๆœƒๆ‹ฟ่‡ชๅทฑ็š„ๆ ธๅฟƒๅˆฉ็›Šๅšไบคๆ˜“๏ผŒไธ่ฆๆŒ‡ๆœ›ๆˆ‘ๅ€‘ๆœƒๅžไธ‹ๆๅฎณๆˆ‘ๅœ‹ไธปๆฌŠใ€ๅฎ‰ๅ…จใ€็™ผๅฑ•ๅˆฉ็›Š็š„่‹ฆๆžœ๏ผ'
76
- # text = 'Los partidos polรญticos tradicionales compiten con los populismos y los movimientos asamblearios.'
77
- # text = 'Le dromadaire resplendissant dรฉambulait tranquillement dans les mรฉandres en mastiquant de petites feuilles vernissรฉes.'
78
- # text = 'เคŸเฅเคฐเคพเค‚เคธเคชเฅ‹เคฐเฅเคŸเคฐเฅ‹เค‚ เค•เฅ€ เคนเคกเคผเคคเคพเคฒ เคฒเค—เคพเคคเคพเคฐ เคชเคพเค‚เคšเคตเฅ‡เค‚ เคฆเคฟเคจ เคœเคพเคฐเฅ€, เคฆเคฟเคธเค‚เคฌเคฐ เคธเฅ‡ เค‡เคฒเฅ‡เค•เฅเคŸเฅเคฐเฅ‰เคจเคฟเค• เคŸเฅ‹เคฒ เค•เคฒเฅ‡เค•เฅเคถเคจเคฒ เคธเคฟเคธเฅเคŸเคฎ'
79
- # text = "Allora cominciava l'insonnia, o un dormiveglia peggiore dell'insonnia, che talvolta assumeva i caratteri dell'incubo."
80
- # text = 'Elabora relatรณrios de acompanhamento cronolรณgico para as diferentes unidades do Departamento que propรตem contratos.'
81
-
82
- # 4๏ธโƒฃ Generate, display, and save audio files in a loop.
83
- generator = pipeline(
84
- text, voice='af_heart', # <= change voice here
85
- speed=1, split_pattern=r'\n+'
86
- )
87
- for i, (gs, ps, audio) in enumerate(generator):
88
- print(i) # i => index
89
- print(gs) # gs => graphemes/text
90
- print(ps) # ps => phonemes
91
- display(Audio(data=audio, rate=24000, autoplay=i==0))
92
- sf.write(f'{i}.wav', audio, 24000) # save each audio file
93
  ```
94
 
95
- Under the hood, `kokoro` uses [`misaki`](https://pypi.org/project/misaki/), a G2P library at https://github.com/hexgrad/misaki
96
-
97
- ### Model Facts
98
-
99
- **Architecture:**
100
- - StyleTTS 2: https://arxiv.org/abs/2306.07691
101
- - ISTFTNet: https://arxiv.org/abs/2203.02395
102
- - Decoder only: no diffusion, no encoder release
103
-
104
- **Architected by:** Li et al @ https://github.com/yl4579/StyleTTS2
105
-
106
- **Trained by**: `@rzvzn` on Discord
107
-
108
- **Languages:** American English, British English, French, Hindi
109
-
110
- **Model SHA256 Hash:** `496dba118d1a58f5f3db2efc88dbdc216e0483fc89fe6e47ee1f2c53f18ad1e4`
111
-
112
- ### Training Details
113
-
114
- **Data:** Kokoro was trained exclusively on **permissive/non-copyrighted audio data** and IPA phoneme labels. Examples of permissive/non-copyrighted audio include:
115
- - Public domain audio
116
- - Audio licensed under Apache, MIT, etc
117
- - Synthetic audio<sup>[1]</sup> generated by closed<sup>[2]</sup> TTS models from large providers<br/>
118
- [1] https://copyright.gov/ai/ai_policy_guidance.pdf<br/>
119
- [2] No synthetic audio from open TTS models or "custom voice clones"
120
-
121
- **Total Dataset Size:** A few hundred hours of audio
122
-
123
- **Total Training Cost:** About $1000 for 1000 hours of A100 80GB vRAM
124
-
125
- ### Creative Commons Attribution
126
-
127
- The following CC BY audio was part of the dataset used to train Kokoro v1.0.
128
-
129
- | Audio Data | Duration Used | License | Added to Training Set After |
130
- | ---------- | ------------- | ------- | --------------------------- |
131
- | [Koniwa](https://github.com/koniwa/koniwa) `tnc` | <1h | [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/deed.ja) | v0.19 / 22 Nov 2024 |
132
- | [SIWIS](https://datashare.ed.ac.uk/handle/10283/2353) | <11h | [CC BY 4.0](https://datashare.ed.ac.uk/bitstream/handle/10283/2353/license_text) | v0.19 / 22 Nov 2024 |
133
-
134
- ### Acknowledgements
135
-
136
- - ๐Ÿ› ๏ธ [@yl4579](https://huggingface.co/yl4579) for architecting StyleTTS 2.
137
- - ๐Ÿ† [@Pendrokar](https://huggingface.co/Pendrokar) for adding Kokoro as a contender in the TTS Spaces Arena.
138
- - ๐Ÿ“Š Thank you to everyone who contributed synthetic training data.
139
- - โค๏ธ Special thanks to all compute sponsors.
140
- - ๐Ÿ‘พ Discord server: https://discord.gg/QuGxSWBfQy
141
- - ๐Ÿชฝ Kokoro is a Japanese word that translates to "heart" or "spirit". Kokoro is also the name of an [AI in the Terminator franchise](https://terminator.fandom.com/wiki/Kokoro).
142
-
143
- <img src="https://static0.gamerantimages.com/wordpress/wp-content/uploads/2024/08/terminator-zero-41-1.jpg" width="400" alt="kokoro" />
 
6
  - yl4579/StyleTTS2-LJSpeech
7
  pipeline_tag: text-to-speech
8
  ---
9
+ # mlx-community/Kokoro-82M-4bit
10
+ This model was converted to MLX format from [`hexagrad/Kokoro-82M`]() using mlx-audio version **0.0.1**.
11
+ Refer to the [original model card](https://huggingface.co/hexagrad/Kokoro-82M) for more details on the model.
12
+ ## Use with mlx
13
 
14
+ ```bash
15
+ pip install -U mlx-audio
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ```
17
 
18
+ ```bash
19
+ python -m mlx_audio.tts.generate --model mlx-community/Kokoro-82M-4bit --text "Hello world"
20
+ ```