Text-to-Audio
Transformers
PyTorch
Japanese
parler_tts
text-generation
text-to-speech
annotation
japanese
Instructions to use 2121-8/japanese-parler-tts-mini-bate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 2121-8/japanese-parler-tts-mini-bate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="2121-8/japanese-parler-tts-mini-bate")# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("2121-8/japanese-parler-tts-mini-bate", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ja
|
| 4 |
+
base_model:
|
| 5 |
+
- parler-tts/parler-tts-mini-v1
|
| 6 |
+
- retrieva-jp/t5-base-long
|
| 7 |
+
datasets:
|
| 8 |
+
- ylacombe/libritts_r_filtered
|
| 9 |
+
- ylacombe/libritts-r-filtered-descriptions-10k-v5-without-accents
|
| 10 |
+
pipeline_tag: text-to-audio
|
| 11 |
+
library_name: transformers
|
| 12 |
+
tags:
|
| 13 |
+
- text-to-speech
|
| 14 |
+
- annotation
|
| 15 |
+
- japanese
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Japanese Parler-TTS Mini (β版)
|
| 21 |
+
|
| 22 |
+
このリポジトリは、[parler-tts/parler-tts-mini-v1](https://huggingface.co/parler-tts/parler-tts-mini-v1)を基に、日本語でのテキスト読み上げを可能にするよう再学習したモデルを公開しています。本モデルは、軽量でありながら高品質な音声生成を提供します。
|
| 23 |
+
|
| 24 |
+
**注意**: 本家の[Parler-TTS](https://huggingface.co/collections/parler-tts/parler-tts-fully-open-source-high-quality-tts-66164ad285ba03e8ffde214c)で使用されているtokenizerとは互換性がありません。本モデル用に独自のtokenizerが採用されています。
|
| 25 |
+
|
| 26 |
+
**現在このリポジトリはβ版です**。機能やモデルの最適化は正式リリースに向けて進行中です。
|
| 27 |
+
|
| 28 |
+
正式リリース版のURL: 準備中
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## Japanese Parler-TTS Index
|
| 34 |
+
|
| 35 |
+
- [Japanese Parler-TTS Mini (878M)](https://huggingface.co/2121-8/japanese-parler-tts-mini-bate)
|
| 36 |
+
- [Japanese Parler-TTS Large (2.33B)](https://huggingface.co/2121-8/japanese-parler-tts-large-bate)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## 📖 クイックインデックス
|
| 42 |
+
* [👨💻 インストール](#👨💻-インストール)
|
| 43 |
+
* [🎲 ランダムな音声での使用方法](#🎲-ランダムな音声での使用方法)
|
| 44 |
+
* [🎯 特定の話者を指定する方法](#🎯-特定の話者を指定する方法)
|
| 45 |
+
* [謝辞](#謝辞)
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
## 🛠️ 使用方法
|
| 50 |
+
|
| 51 |
+
### 👨💻 インストール
|
| 52 |
+
|
| 53 |
+
以下のコマンドでインストールできます。
|
| 54 |
+
|
| 55 |
+
```sh
|
| 56 |
+
pip install git+https://github.com/huggingface/parler-tts.git
|
| 57 |
+
pip install git+https://github.com/getuka/RubyInserter.git
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
### 🎲 ランダムな音声での使用方法
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
import torch
|
| 66 |
+
from parler_tts import ParlerTTSForConditionalGeneration
|
| 67 |
+
from transformers import AutoTokenizer
|
| 68 |
+
import soundfile as sf
|
| 69 |
+
|
| 70 |
+
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 71 |
+
|
| 72 |
+
model = ParlerTTSForConditionalGeneration.from_pretrained("2121-8/japanese-parler-tts-mini-bate").to(device)
|
| 73 |
+
tokenizer = AutoTokenizer.from_pretrained("2121-8/japanese-parler-tts-mini-bate")
|
| 74 |
+
|
| 75 |
+
prompt = "こんにちは、今日はどのようにお過ごしですか?"
|
| 76 |
+
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."
|
| 77 |
+
|
| 78 |
+
input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
|
| 79 |
+
prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
|
| 80 |
+
|
| 81 |
+
generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
|
| 82 |
+
audio_arr = generation.cpu().numpy().squeeze()
|
| 83 |
+
sf.write("parler_tts_japanese_out.wav", audio_arr, model.config.sampling_rate)
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
### サンプル音声
|
| 88 |
+
|
| 89 |
+
<audio controls>
|
| 90 |
+
<source src="https://huggingface.co/2121-8/japanese-parler-tts-mini-bate/resolve/main/audio/audio_parler_tts_japanese_out_sample_1.wav" type="audio/wav">
|
| 91 |
+
お使いのブラウザはオーディオタグをサポートしていません。
|
| 92 |
+
</audio>
|
| 93 |
+
</br>
|
| 94 |
+
<audio controls>
|
| 95 |
+
<source src="https://huggingface.co/2121-8/japanese-parler-tts-mini-bate/resolve/main/audio/audio_parler_tts_japanese_out_sample_2.wav" type="audio/wav">
|
| 96 |
+
お使いのブラウザはオーディオタグをサポートしていません。
|
| 97 |
+
</audio>
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
### 🎯 特定の話者を指定する方法
|
| 102 |
+
|
| 103 |
+
準備中
|
| 104 |
+
|
| 105 |
+
---
|