Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
from datetime import datetime
|
|
|
2 |
from huggingface_hub import snapshot_download
|
3 |
from katsu import Katsu
|
4 |
from models import build_model
|
@@ -32,6 +33,11 @@ for key, state_dict in torch.load(os.path.join(snapshot, 'net.pth'), map_locatio
|
|
32 |
|
33 |
PARAM_COUNT = sum(p.numel() for value in models['cpu'].values() for p in value.parameters())
|
34 |
assert PARAM_COUNT < 82_000_000, PARAM_COUNT
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
random_texts = {}
|
37 |
for lang in ['en', 'fr', 'ja', 'ko', 'zh']:
|
@@ -379,6 +385,8 @@ with gr.Blocks() as ml_tts:
|
|
379 |
trim = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label='✂️ Trim', info='How much to cut from both ends')
|
380 |
with gr.Row():
|
381 |
gr.Markdown('''
|
|
|
|
|
382 |
🎉 New! Kokoro v0.23 now supports 5 languages. 🎉
|
383 |
|
384 |
🧪 Note that v0.23 is experimental/WIP and may produce shaky speech. v0.19 is the last stable version.
|
@@ -638,7 +646,7 @@ Kokoro is a frontier TTS model for its size. It has [82 million](https://hf.co/s
|
|
638 |
|
639 |
### FAQ
|
640 |
**Will this be open sourced?**<br/>
|
641 |
-
|
642 |
|
643 |
**What is the difference between stable and unstable voices?**<br/>
|
644 |
Unstable voices are more likely to stumble or produce unnatural artifacts, especially on short or strange texts. Stable voices are more likely to deliver natural speech on a wider range of inputs. The first two audio clips in this [blog post](https://hf.co/blog/hexgrad/kokoro-short-burst-upgrade) are examples of unstable and stable speech. Note that even unstable voices can sound fine on medium to long texts.
|
@@ -685,6 +693,9 @@ This Space and the underlying Kokoro model are both under development and subjec
|
|
685 |
'''
|
686 |
with gr.Blocks() as changelog:
|
687 |
gr.Markdown('''
|
|
|
|
|
|
|
688 |
**11 Dec 2024**<br/>
|
689 |
🚀 Multilingual v0.23<br/>
|
690 |
🗣️ 85 total voices
|
|
|
1 |
from datetime import datetime
|
2 |
+
from hashlib import sha256
|
3 |
from huggingface_hub import snapshot_download
|
4 |
from katsu import Katsu
|
5 |
from models import build_model
|
|
|
33 |
|
34 |
PARAM_COUNT = sum(p.numel() for value in models['cpu'].values() for p in value.parameters())
|
35 |
assert PARAM_COUNT < 82_000_000, PARAM_COUNT
|
36 |
+
with open(os.path.join(snapshot, 'net.pth'), 'rb') as rb:
|
37 |
+
model_hash = sha256(rb.read()).hexdigest()
|
38 |
+
print('model_hash', model_hash)
|
39 |
+
# SHA256 hash matches https://huggingface.co/hexgrad/Kokoro-82M/blob/main/kokoro-v0_19.pth
|
40 |
+
assert model_hash == '3b0c392f87508da38fad3a2f9d94c359f1b657ebd2ef79f9d56d69503e470b0a'
|
41 |
|
42 |
random_texts = {}
|
43 |
for lang in ['en', 'fr', 'ja', 'ko', 'zh']:
|
|
|
385 |
trim = gr.Slider(minimum=0, maximum=1, value=0.5, step=0.1, label='✂️ Trim', info='How much to cut from both ends')
|
386 |
with gr.Row():
|
387 |
gr.Markdown('''
|
388 |
+
🎄 Kokoro v0.19, Bella, & Sarah have been open sourced at [hf.co/hexgrad/Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M)
|
389 |
+
|
390 |
🎉 New! Kokoro v0.23 now supports 5 languages. 🎉
|
391 |
|
392 |
🧪 Note that v0.23 is experimental/WIP and may produce shaky speech. v0.19 is the last stable version.
|
|
|
646 |
|
647 |
### FAQ
|
648 |
**Will this be open sourced?**<br/>
|
649 |
+
v0.19 has been open sourced at [hf.co/hexgrad/Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) along with the voicepacks Bella, Sarah, and `af`. There currently isn't a release date scheduled for the other voices.
|
650 |
|
651 |
**What is the difference between stable and unstable voices?**<br/>
|
652 |
Unstable voices are more likely to stumble or produce unnatural artifacts, especially on short or strange texts. Stable voices are more likely to deliver natural speech on a wider range of inputs. The first two audio clips in this [blog post](https://hf.co/blog/hexgrad/kokoro-short-burst-upgrade) are examples of unstable and stable speech. Note that even unstable voices can sound fine on medium to long texts.
|
|
|
693 |
'''
|
694 |
with gr.Blocks() as changelog:
|
695 |
gr.Markdown('''
|
696 |
+
**25 Dec 2024**<br/>
|
697 |
+
🎄 Kokoro v0.19, Bella, & Sarah have been open sourced at [hf.co/hexgrad/Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M)
|
698 |
+
|
699 |
**11 Dec 2024**<br/>
|
700 |
🚀 Multilingual v0.23<br/>
|
701 |
🗣️ 85 total voices
|