Update README.md
Browse files
README.md
CHANGED
|
@@ -31,71 +31,134 @@ pipeline_tag: text-to-speech
|
|
| 31 |
|
| 32 |
## Introduction
|
| 33 |
ADIA_TTS est un modèle de synthèse vocale (Text-to-Speech) en wolof, développé par CONCREE pour démocratiser l'accès aux technologies vocales dans les langues africaines. Basé sur le modèle parler-tts-mini-multilingual-v1.1, il représente une avancée significative dans la synthèse vocale pour la langue wolof.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
```sh
|
| 35 |
pip install git+https://github.com/huggingface/parler-tts.git
|
| 36 |
```
|
| 37 |
|
| 38 |
## Utilisation
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
### Exemple d'utilisation
|
| 42 |
-
Le code suivant montre comment utiliser ADIA_TTS pour générer un fichier audio :
|
| 43 |
-
|
| 44 |
-
```py
|
| 45 |
import torch
|
| 46 |
from parler_tts import ParlerTTSForConditionalGeneration
|
| 47 |
from transformers import AutoTokenizer
|
| 48 |
-
from IPython.display import Audio
|
| 49 |
import soundfile as sf
|
| 50 |
|
| 51 |
-
# Détection de l'appareil disponible
|
| 52 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 53 |
|
| 54 |
-
# Chargement du modèle
|
| 55 |
model = ParlerTTSForConditionalGeneration.from_pretrained("CONCREE/Adia_TTS").to(device)
|
| 56 |
tokenizer = AutoTokenizer.from_pretrained("CONCREE/Adia_TTS")
|
| 57 |
|
| 58 |
-
#
|
| 59 |
-
|
| 60 |
|
| 61 |
-
# Description
|
| 62 |
-
description = "A
|
| 63 |
|
| 64 |
-
#
|
| 65 |
input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
-
generation = model.generate(
|
| 70 |
input_ids=input_ids,
|
| 71 |
-
prompt_input_ids=
|
| 72 |
)
|
| 73 |
|
| 74 |
-
|
| 75 |
-
sf.write("
|
| 76 |
-
|
| 77 |
-
```
|
| 78 |
-
# Exemple:
|
| 79 |
-
"Entreprenariat ci Senegal dafa am solo lool ci yokkuteg koom-koom, di gëna yokk liggéey ak indi gis-gis yu bees ci dëkk bi."
|
| 80 |
<audio controls>
|
| 81 |
-
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/
|
| 82 |
</audio>
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
```py
|
| 89 |
-
description = "
|
| 90 |
-
description = "Adia's speech is very quiet and monotone, delivered with a very small amount of discernible expression."
|
| 91 |
-
description = "Adia's voice comes across as very monotone, speaking slowly with very clear sounds and no background noise."
|
| 92 |
-
description = "A warm, natural, and friendly voice with a steady pace and clear pronunciation. The audio is crisp with no background noise, and the delivery is expressive but calm, giving a conversational feel."
|
| 93 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
## Références
|
| 98 |
-
|
|
|
|
| 99 |
@misc{CONCREE-2024-Adia_TTS,
|
| 100 |
author = {CONCREE},
|
| 101 |
title = {Adia_TTS},
|
|
@@ -116,5 +179,17 @@ En variant la description, vous pouvez obtenir une sortie vocale différente en
|
|
| 116 |
```
|
| 117 |
|
| 118 |
## Licence
|
| 119 |
-
Ce
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
|
|
|
|
|
| 31 |
|
| 32 |
## Introduction
|
| 33 |
ADIA_TTS est un modèle de synthèse vocale (Text-to-Speech) en wolof, développé par CONCREE pour démocratiser l'accès aux technologies vocales dans les langues africaines. Basé sur le modèle parler-tts-mini-multilingual-v1.1, il représente une avancée significative dans la synthèse vocale pour la langue wolof.
|
| 34 |
+
|
| 35 |
+
## Points clés
|
| 36 |
+
* Entraîné sur 40 heures de données vocales en wolof
|
| 37 |
+
* Affiné pendant 100 epochs (~168 heures d'entraînement)
|
| 38 |
+
* Qualité vocale naturelle et fluide
|
| 39 |
+
* Support multilocuteur avec contrôle des caractéristiques vocales
|
| 40 |
+
|
| 41 |
+
## Caractéristiques techniques
|
| 42 |
+
|
| 43 |
+
### Spécifications du modèle
|
| 44 |
+
|
| 45 |
+
* Architecture : parler-tts-mini-multilingual-v1.1
|
| 46 |
+
* Taille du modèle : 1.88 GB
|
| 47 |
+
* Format du modèle : PyTorch
|
| 48 |
+
* Fréquence d'échantillonnage : 24kHz
|
| 49 |
+
* Encodage audio : 16-bit PCM
|
| 50 |
+
|
| 51 |
+
### Performance
|
| 52 |
+
|
| 53 |
+
* Temps moyen d'inférence : secondes/phrase (CPU), 20 secondes/phrase (GPU)
|
| 54 |
+
* Consommation mémoire : 3.9 GB (RAM minimale recommandée)
|
| 55 |
+
* Support CUDA : Oui, compatible avec CUDA T4, A100 et version supérieur
|
| 56 |
+
|
| 57 |
+
## Installation
|
| 58 |
+
### Prérequis
|
| 59 |
+
Python 3.8 ou supérieur
|
| 60 |
+
PyTorch 2.0 ou supérieur
|
| 61 |
+
CUDA (obligatoire, pour accélération GPU)
|
| 62 |
+
###Installation via pip
|
| 63 |
```sh
|
| 64 |
pip install git+https://github.com/huggingface/parler-tts.git
|
| 65 |
```
|
| 66 |
|
| 67 |
## Utilisation
|
| 68 |
+
## Exemple de base
|
| 69 |
+
'''py
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
import torch
|
| 71 |
from parler_tts import ParlerTTSForConditionalGeneration
|
| 72 |
from transformers import AutoTokenizer
|
|
|
|
| 73 |
import soundfile as sf
|
| 74 |
|
|
|
|
| 75 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 76 |
|
| 77 |
+
# Chargement du modèle
|
| 78 |
model = ParlerTTSForConditionalGeneration.from_pretrained("CONCREE/Adia_TTS").to(device)
|
| 79 |
tokenizer = AutoTokenizer.from_pretrained("CONCREE/Adia_TTS")
|
| 80 |
|
| 81 |
+
# Texte en wolof à synthétiser
|
| 82 |
+
text = "Entreprenariat ci Senegal dafa am solo lool ci yokkuteg koom-koom, di gëna yokk liggéey ak indi gis-gis yu bees ci dëkk bi."
|
| 83 |
|
| 84 |
+
# Description du style vocal
|
| 85 |
+
description = "A clear and educational voice, with a flow adapted to learning"
|
| 86 |
|
| 87 |
+
# Génération
|
| 88 |
input_ids = tokenizer(description, return_tensors="pt").input_ids.to(device)
|
| 89 |
+
prompt_ids = tokenizer(text, return_tensors="pt").input_ids.to(device)
|
| 90 |
|
| 91 |
+
audio = model.generate(
|
|
|
|
| 92 |
input_ids=input_ids,
|
| 93 |
+
prompt_input_ids=prompt_ids,
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# Sauvegarde
|
| 97 |
+
sf.write("output.wav", audio.cpu().numpy().squeeze(), model.config.sampling_rate)
|
| 98 |
+
'''
|
|
|
|
|
|
|
|
|
|
| 99 |
<audio controls>
|
| 100 |
+
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/snt.wav" type="audio/wav">
|
| 101 |
</audio>
|
| 102 |
|
| 103 |
+
## Configuration avancée
|
| 104 |
+
## Paramètres de génération
|
| 105 |
+
'''py
|
| 106 |
+
generation_config = {
|
| 107 |
+
"temperature": 0.8, # Contrôle la variabilité de la sortie
|
| 108 |
+
"max_new_tokens": 1000, # Longueur maximale de la séquence générée
|
| 109 |
+
"do_sample": True, # Active l'échantillonnage aléatoire
|
| 110 |
+
"top_k": 50, # Limite le nombre de tokens considérés
|
| 111 |
+
"repetition_penalty": 1.2, # Pénalise la répétition de tokens
|
| 112 |
+
}
|
| 113 |
|
| 114 |
+
audio = model.generate(
|
| 115 |
+
input_ids=input_ids,
|
| 116 |
+
prompt_input_ids=prompt_ids,
|
| 117 |
+
**generation_config
|
| 118 |
+
)
|
| 119 |
+
'''
|
| 120 |
+
<audio controls>
|
| 121 |
+
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/avct.wav" type="audio/wav">
|
| 122 |
+
</audio>
|
| 123 |
|
| 124 |
+
## Styles vocaux
|
| 125 |
+
### Exemples de descriptions pour différents styles :
|
| 126 |
+
|
| 127 |
+
1. ### Voix naturelle
|
| 128 |
+
|
| 129 |
```py
|
| 130 |
+
description = "A warm and natural voice, with a conversational flow"
|
|
|
|
|
|
|
|
|
|
| 131 |
```
|
| 132 |
+
<audio controls>
|
| 133 |
+
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/styl1.wav" type="audio/wav">
|
| 134 |
+
</audio>
|
| 135 |
+
|
| 136 |
+
2. ### Voix professionnelle
|
| 137 |
|
| 138 |
+
'''py
|
| 139 |
+
description = "A professional, clear and composed voice, perfect for formal presentations"
|
| 140 |
+
'''
|
| 141 |
+
<audio controls>
|
| 142 |
+
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/styl2.wav" type="audio/wav">
|
| 143 |
+
</audio>
|
| 144 |
|
| 145 |
+
3. ### Voix pour l'éducation
|
| 146 |
+
'''py
|
| 147 |
+
description = "A clear and educational voice, with a flow adapted to learning"
|
| 148 |
+
'''
|
| 149 |
+
<audio controls>
|
| 150 |
+
<source src="https://huggingface.co/spaces/CONCREE/Adia_TTS/resolve/main/styl3.wav" type="audio/wav">
|
| 151 |
+
</audio>
|
| 152 |
+
|
| 153 |
+
## Limitations connues
|
| 154 |
+
|
| 155 |
+
* Performance réduite sur les phrases très longues (>200 caractères )
|
| 156 |
+
* Gestion limitée des nombres et des dates
|
| 157 |
+
* Variations possibles dans la qualité selon l'accent régional
|
| 158 |
+
* Temps de chargement initial du modèle relativement long
|
| 159 |
## Références
|
| 160 |
+
|
| 161 |
+
'''
|
| 162 |
@misc{CONCREE-2024-Adia_TTS,
|
| 163 |
author = {CONCREE},
|
| 164 |
title = {Adia_TTS},
|
|
|
|
| 179 |
```
|
| 180 |
|
| 181 |
## Licence
|
| 182 |
+
Ce projet est sous licence Apache 2.0. Voir le fichier LICENSE pour plus de détails.
|
| 183 |
+
|
| 184 |
+
## Conditions d'utilisation
|
| 185 |
+
|
| 186 |
+
* Usage commercial autorisé
|
| 187 |
+
* Modification autorisée
|
| 188 |
+
* Distribution autorisée
|
| 189 |
+
* Obligation de mention de licence
|
| 190 |
+
* Pas de garantie fournie
|
| 191 |
+
|
| 192 |
+
## Contact
|
| 193 |
+
Pour toute question ou support :
|
| 194 |
|
| 195 |
+
Email : contact@concree.com
|