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 install hayakoe

# GPU (PyTorch CUDA 별도 설치 필요)
pip install torch --index-url https://download.pytorch.org/whl/cu126
pip install hayakoe[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.2.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.2-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hayakoe-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2f0dc888658f479ad7f6f60bedf794a871b68a0131af8c40dcfd682c2c6f95d4
MD5 2109ea4f799167aa94fee1853cb69fe7
BLAKE2b-256 4f878cb1d6d511e2bcc1c8f08dd96b522e3271ab4a58e9974adca83d7b29bc40

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayakoe-0.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: hayakoe-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed094dcc348f8d9e33c2bce58adc4e1a39bbe2e3f4ad1c5660b40dc13c45e4fd
MD5 ee48c688d0661723c160426c2d9bffb8
BLAKE2b-256 3ef79d571dbb66c463f7d0e67208e992673563faf8d82fa019e92ca24c980e94

See more details on using hashes here.

Provenance

The following attestation bundles were made for hayakoe-0.0.2-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