Skip to content

Commit 6489eea

Browse files
authored
Merge pull request #151 from gbaian10/ruff_isort
feat: add New Ruff rules
2 parents 2408a69 + cfe6633 commit 6489eea

35 files changed

+128
-208
lines changed

.vscode/settings.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"editor.formatOnSave": true
3-
}
2+
"editor.formatOnSave": true,
3+
"[python]": {
4+
"editor.defaultFormatter": "charliermarsh.ruff",
5+
"editor.codeActionsOnSave": {
6+
"source.organizeImports.ruff": "always"
7+
}
8+
}
9+
}

CONTRIBUTE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ uv run ruff format
1919
uv run ruff check
2020
```
2121

22+
If you want to use ruff for quick [safety fixes](https://docs.astral.sh/ruff/linter/#fix-safety),
23+
you can run the following command:
24+
25+
```console
26+
uv run ruff check --fix
27+
```
28+
2229
## Pull Request Guidelines
2330

2431
Do not create a pull request from your main branch. This ensures we can collaborate and edit the PR if needed.

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
# kokoro-onnx
22

3+
![Python Version](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
4+
[![PyPI Release](https://img.shields.io/pypi/v/kokoro-onnx.svg)](https://pypi.org/project/kokoro-onnx/)
5+
[![Github Model Releases](https://img.shields.io/github/v/release/thewh1teagle/kokoro-onnx)](https://github.com/thewh1teagle/kokoro-onnx/releases)
6+
[![License](https://img.shields.io/github/license/thewh1teagle/kokoro-onnx)](https://github.com/thewh1teagle/kokoro-onnx/blob/main/LICENSE)
7+
[![GitHub stars](https://img.shields.io/github/stars/thewh1teagle/kokoro-onnx?style=social)](https://github.com/thewh1teagle/kokoro-onnx/stargazers)
8+
[![PyPI Downloads](https://img.shields.io/pypi/dm/kokoro-onnx?style=plastic)](https://pypi.org/project/kokoro-onnx/)
9+
10+
[![ONNX Runtime](https://img.shields.io/badge/ONNX%20Runtime-%E2%89%A51.20.1-blue)](https://github.com/microsoft/onnxruntime)
11+
![CPU](https://img.shields.io/badge/CPU-supported-brightgreen)
12+
![GPU](https://img.shields.io/badge/GPU-supported-brightgreen)
13+
314
TTS with onnx runtime based on [Kokoro-TTS](https://huggingface.co/spaces/hexgrad/Kokoro-TTS)
415

516
🚀 Version 1.0 models are out now! 🎉
617

7-
https://github.com/user-attachments/assets/00ca06e8-bbbd-4e08-bfb7-23c0acb10ef9
18+
<https://github.com/user-attachments/assets/00ca06e8-bbbd-4e08-bfb7-23c0acb10ef9>
819

920
## Features
1021

11-
- Supports multiple languages
22+
- Supports multiple languages
1223
- Fast performance near real-time on macOS M1
1324
- Offer multiple voices
1425
- Lightweight: ~300MB (quantized: ~80MB)

examples/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"""
1717

1818
import gradio as gr
19+
import numpy as np
20+
1921
from kokoro_onnx import Kokoro
2022
from kokoro_onnx.tokenizer import Tokenizer
21-
import numpy as np
2223

2324
tokenizer = Tokenizer()
2425
kokoro = Kokoro("kokoro-v1.0.onnx", "voices-v1.0.bin")

examples/chinese.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import zh
2322

23+
from kokoro_onnx import Kokoro
24+
2425
# Misaki G2P with espeak-ng fallback
2526
g2p = zh.ZHG2P(version="1.1")
2627

examples/english.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import en, espeak
2322

23+
from kokoro_onnx import Kokoro
24+
2425
# Misaki G2P with espeak-ng fallback
2526
fallback = espeak.EspeakFallback(british=False)
2627
g2p = en.G2P(trf=False, british=False, fallback=fallback)

examples/french.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import espeak
2322
from misaki.espeak import EspeakG2P
2423

24+
from kokoro_onnx import Kokoro
25+
2526
# Misaki G2P with espeak-ng fallback
2627
fallback = espeak.EspeakFallback(british=False)
2728
g2p = EspeakG2P(language="fr-fr")

examples/hindi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import espeak
2322
from misaki.espeak import EspeakG2P
2423

24+
from kokoro_onnx import Kokoro
25+
2526
# Misaki G2P with espeak-ng fallback
2627
fallback = espeak.EspeakFallback(british=False)
2728
g2p = EspeakG2P(language="hi")

examples/italian.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import espeak
2322
from misaki.espeak import EspeakG2P
2423

24+
from kokoro_onnx import Kokoro
25+
2526
# Misaki G2P with espeak-ng fallback
2627
fallback = espeak.EspeakFallback(british=False)
2728
g2p = EspeakG2P(language="it")

examples/japanse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"""
1919

2020
import soundfile as sf
21-
from kokoro_onnx import Kokoro
2221
from misaki import ja
2322

23+
from kokoro_onnx import Kokoro
24+
2425
# Misaki G2P with espeak-ng fallback
2526
g2p = ja.JAG2P()
2627

0 commit comments

Comments
 (0)