File size: 3,424 Bytes
6f62095
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
language:
- ja
base_model:
- parler-tts/parler-tts-large-v1
- retrieva-jp/t5-base-long
datasets:
- ylacombe/libritts_r_filtered
- ylacombe/libritts-r-filtered-descriptions-10k-v5-without-accents
pipeline_tag: text-to-audio
library_name: transformers
tags:
  - text-to-speech
  - annotation
  - japanese
---



# Japanese Parler-TTS Large (β版)

このリポジトリは、[parler-tts/parler-tts-large-v1](https://huggingface.co/parler-tts/parler-tts-large-v1)を基に、日本語でのテキスト読み上げを可能にするよう再学習したモデルを公開しています。本モデルは、軽量でありながら高品質な音声生成を提供します。

**注意**: 本家の[Parler-TTS](https://huggingface.co/collections/parler-tts/parler-tts-fully-open-source-high-quality-tts-66164ad285ba03e8ffde214c)で使用されているtokenizerとは互換性がありません。本モデル用に独自のtokenizerが採用されています。

**現在このリポジトリはβ版です**。機能やモデルの最適化は正式リリースに向けて進行中です。

正式リリース版のURL: 準備中

---


## Japanese Parler-TTS Index

- [Japanese Parler-TTS Mini (878M)](https://huggingface.co/2121-8/japanese-parler-tts-mini-bate)
- [Japanese Parler-TTS Large (2.33B)](https://huggingface.co/2121-8/japanese-parler-tts-large-bate)


---

## 📖 クイックインデックス
* [👨‍💻 インストール](#👨‍💻-インストール)
* [🎲 ランダムな音声での使用方法](#🎲-ランダムな音声での使用方法)
* [🎯 特定の話者を指定する方法](#🎯-特定の話者を指定する方法)
* [謝辞](#謝辞)

---

## 🛠️ 使用方法

### 👨‍💻 インストール

以下のコマンドでインストールできます。

```sh
pip install git+https://github.com/huggingface/parler-tts.git
pip install git+https://github.com/getuka/RubyInserter.git
```

---

### 🎲 ランダムな音声での使用方法

```python
import torch
from parler_tts import ParlerTTSForConditionalGeneration
from transformers import AutoTokenizer
import soundfile as sf

device = "cuda:0" if torch.cuda.is_available() else "cpu"

model = ParlerTTSForConditionalGeneration.from_pretrained("2121-8/japanese-parler-tts-large-bate").to(device)
tokenizer = AutoTokenizer.from_pretrained("2121-8/japanese-parler-tts-large-bate")

prompt = "こんにちは、今日はどのようにお過ごしですか?"
description = "A female speaker with a slightly high-pitched voice delivers her words at a moderate speed with a quite monotone tone in a confined environment, resulting in a quite clear audio recording."

input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)

generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
audio_arr = generation.cpu().numpy().squeeze()
sf.write("parler_tts_japanese_out.wav", audio_arr, model.config.sampling_rate)
```

---

### 🎯 特定の話者を指定する方法

準備中

---

## 謝辞

本モデルの開発にあたり、以下の資源提供をしていただいた方々に感謝いたします。

- [saldra](https://x.com/sald_ra)
- [Witness](https://x.com/i_witnessed_it)

彼らの貢献がなければ、このプロジェクトは実現しませんでした。

---