Skip to main content

HayaKoe — Fast ONNX-optimized Japanese TTS based on Style-Bert-VITS2

Project description

HayaKoe

Style-Bert-VITS2를 기반으로 한 고속 일본어 TTS 라이브러리.

Based on Style-Bert-VITS2 by litagin02 (AGPL-3.0)

특징

  • ONNX 최적화 — CPU 실시간 추론 (PyTorch 대비 1.6x 속도 향상, 81% RAM 절감)
  • torch 불필요 — CPU 추론 시 PyTorch 없이 동작 (경량 설치)
  • 3줄 추론 — 모델 자동 다운로드, 설정 불필요
  • JP-Extra 모델 — Style-Bert-VITS2 JP-Extra (v2.7.0), DeBERTa JP
  • 영어→카타카나 자동 변환 — 22만 엔트리 외래어 사전 룩업 (의존성 없음)

설치

CPU (기본, torch 불필요)

pip
pip install hayakoe
uv
uv add hayakoe
Poetry
poetry add hayakoe

GPU (PyTorch CUDA 별도 설치 필요)

pip
pip install torch --index-url https://download.pytorch.org/whl/cu126
pip install hayakoe[gpu]
uv
uv add torch --index https://download.pytorch.org/whl/cu126
uv add hayakoe --extra gpu
Poetry
pip install torch --index-url https://download.pytorch.org/whl/cu126
poetry add hayakoe -E gpu

모델은 HuggingFace에서 자동 다운로드됩니다.

사용법

from hayakoe import TTS

speaker = TTS().load("jvnv-F1-jp")
speaker.generate("こんにちは").save("output.wav")

GPU 추론:

speaker = TTS(device="cuda").load("jvnv-F1-jp")
speaker.generate("こんにちは").save("output.wav")

파라미터 조절:

audio = speaker.generate(
    "今日はどんな国に辿り着くのでしょうか。楽しみですね。",
    style="Neutral",
    speed=0.9,
    sdp_ratio=0.2,
    noise=0.6,
    noise_w=0.8,
    pitch_scale=1.0,
    intonation_scale=1.0,
    style_weight=1.0,
)

사용 가능한 화자

이름 설명
jvnv-F1-jp 여성 화자 1
jvnv-F2-jp 여성 화자 2
jvnv-M1-jp 남성 화자 1
jvnv-M2-jp 남성 화자 2

각 화자는 7개 스타일을 지원합니다: Neutral, Happy, Sad, Angry, Fear, Surprise, Disgust

Docker / 서버 환경

# 빌드 시점 — 이미지에 모델 포함 (GPU 불필요)
RUN python -c "from hayakoe import TTS; TTS.prepare()"

# 실행 시점 — 다운로드 없이 바로 서빙
CMD ["python", "server.py"]
메서드 다운로드 메모리 로드 GPU 필요 용도
TTS.prepare() O X X Docker 빌드, CI
TTS(device=...) O (없으면) O 선택 추론

유저 사전

pyopenjtalk가 모르는 고유명사의 발음을 등록할 수 있습니다.

# 읽기만 등록 (악센트는 평판)
tts.add_word(surface="担々麺", reading="タンタンメン")

# 악센트 위치도 지정 (3번째 모라에서 피치 하강)
tts.add_word(surface="担々麺", reading="タンタンメン", accent=3)

아키텍처

TTS (엔진)
├── BERT DeBERTa Q8 (ONNX)  ← 자동 다운로드
│
├── speakers["jvnv-F1-jp"]  → Synthesizer ONNX + style vectors
├── speakers["jvnv-F2-jp"]  → ...
└── ...
  • CPU: ONNX Runtime (BERT Q8 + Synthesizer FP32)
  • GPU: PyTorch FP32 (BERT + Synthesizer)

라이선스

  • 코드: AGPL-3.0 (원본 Style-Bert-VITS2)
  • JVNV 음성 모델: CC BY-SA 4.0 (JVNV Corpus)
  • 사전학습 모델 (DeBERTa): MIT
  • 영어→카타카나 사전 데이터: GPL-3.0 (loanwords_gairaigo)

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hayakoe-0.0.6.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hayakoe-0.0.6-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file hayakoe-0.0.6.tar.gz.

File metadata

  • Download URL: hayakoe-0.0.6.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hayakoe-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1f72c4a4cbab5fce2505c117741404864e6d57c4cfaf4b849e02ae1c75e47778
MD5 2ef52699f30ee839d6aff5fc3f6b7260
BLAKE2b-256 5adee0ccf750fb94684ca6c788975ec2b4108c5710cdc3a226b8580e161fd43c

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayakoe-0.0.6.tar.gz:

Publisher: publish.yml on LemonDouble/hayakoe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hayakoe-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: hayakoe-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hayakoe-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f86cc03678dcf2b2a2c7788339771886e9f26d812e75c89ba4a1809238352edf
MD5 f004e03443e0bdddd82148f91e05fab8
BLAKE2b-256 dd3ea38f1a3307613d039dfc5908a766d29aa5e74ea284f18f2c785250a91375

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayakoe-0.0.6-py3-none-any.whl:

Publisher: publish.yml on LemonDouble/hayakoe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page