Text-to-Speech
English
hexgrad commited on
Commit
b018808
·
verified ·
1 Parent(s): c6cb309

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -1
README.md CHANGED
@@ -8,10 +8,76 @@ pipeline_tag: text-to-speech
8
  ---
9
  🚨 **This repository is undergoing maintenance.**
10
 
11
- ♻️ You can access old files at https://huggingface.co/hexgrad/kLegacy/tree/main/v0.19
12
 
13
  ❤️ Kokoro Discord Server: https://discord.gg/QuGxSWBfQy
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  **Model SHA256 Hash:** `496dba118d1a58f5f3db2efc88dbdc216e0483fc89fe6e47ee1f2c53f18ad1e4`
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <img src="https://static0.gamerantimages.com/wordpress/wp-content/uploads/2024/08/terminator-zero-41-1.jpg" width="400" alt="kokoro" />
 
8
  ---
9
  🚨 **This repository is undergoing maintenance.**
10
 
11
+ ♻️ You can access old files for v0.19 at https://huggingface.co/hexgrad/kLegacy/tree/main/v0.19
12
 
13
  ❤️ Kokoro Discord Server: https://discord.gg/QuGxSWBfQy
14
 
15
+ ### Usage
16
+
17
+ The following can be run in a single cell on [Google Colab](https://colab.research.google.com/).
18
+ ```py
19
+ # 1️⃣ Install kokoro
20
+ !pip install -q kokoro soundfile
21
+ # 2️⃣ Install espeak, used for out-of-dictionary fallback
22
+ !apt-get -qq -y install espeak-ng > /dev/null 2>&1
23
+ # You can skip espeak installation, but OOD words will be skipped unless you provide a fallback
24
+
25
+ # 3️⃣ Initalize a pipeline
26
+ from kokoro import KPipeline
27
+ from IPython.display import display, Audio
28
+ import soundfile as sf
29
+ # 🇺🇸 'a' => American English
30
+ # 🇬🇧 'b' => British English
31
+ pipeline = KPipeline(lang_code='a') # make sure lang_code matches voice
32
+
33
+ # The following text is for demonstration purposes only, unseen during training
34
+ text = '''
35
+ The sky above the port was the color of television, tuned to a dead channel.
36
+ "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."
37
+ 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.
38
+
39
+ 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.
40
+ '''
41
+
42
+ # 4️⃣ Generate, display, and save audio files in a loop.
43
+ generator = pipeline(
44
+ text, voice='af_bella',
45
+ speed=1, split_pattern=r'\n+'
46
+ )
47
+ for i, (gs, ps, audio) in enumerate(generator):
48
+ print(i) # i => index
49
+ print(gs) # gs => graphemes/text
50
+ print(ps) # ps => phonemes
51
+ display(Audio(data=audio, rate=24000, autoplay=i==0))
52
+ sf.write(f'{i}.wav', audio, 24000) # save each audio file
53
+ ```
54
+
55
+ ### Model Facts
56
+
57
+ **Architecture:**
58
+ - StyleTTS 2: https://arxiv.org/abs/2306.07691
59
+ - ISTFTNet: https://arxiv.org/abs/2203.02395
60
+ - Decoder only: no diffusion, no encoder release
61
+
62
+ **Architected by:** Li et al @ https://github.com/yl4579/StyleTTS2
63
+
64
+ **Trained by**: `@rzvzn` on Discord
65
+
66
+ **Supported Languages:** American English, British English
67
+
68
  **Model SHA256 Hash:** `496dba118d1a58f5f3db2efc88dbdc216e0483fc89fe6e47ee1f2c53f18ad1e4`
69
 
70
+ ### Training Details
71
+
72
+ **Compute:** About $1000 for 1000 hours of A100 80GB vRAM
73
+
74
+ **Data:** Kokoro was trained exclusively on **permissive/non-copyrighted audio data** and IPA phoneme labels. Examples of permissive/non-copyrighted audio include:
75
+ - Public domain audio
76
+ - Audio licensed under Apache, MIT, etc
77
+ - Synthetic audio<sup>[1]</sup> generated by closed<sup>[2]</sup> TTS models from large providers<br/>
78
+ [1] https://copyright.gov/ai/ai_policy_guidance.pdf<br/>
79
+ [2] No synthetic audio from open TTS models or "custom voice clones"
80
+
81
+ **Total Dataset Size:** A few hundred hours of audio
82
+
83
  <img src="https://static0.gamerantimages.com/wordpress/wp-content/uploads/2024/08/terminator-zero-41-1.jpg" width="400" alt="kokoro" />