Spaces:
Runtime error
Runtime error
Update goai_tts.py
Browse files- goai_tts.py +3 -4
goai_tts.py
CHANGED
@@ -3,8 +3,10 @@ import scipy
|
|
3 |
import time
|
4 |
from transformers import set_seed, pipeline
|
5 |
|
|
|
6 |
|
7 |
-
|
|
|
8 |
"""
|
9 |
Pour un texte donné, donner le speech en Mooré correspondant
|
10 |
|
@@ -12,9 +14,6 @@ def goai_tts(texte, device):
|
|
12 |
----------
|
13 |
texte: str
|
14 |
Le texte écrit.
|
15 |
-
|
16 |
-
device: str
|
17 |
-
GPU ou CPU
|
18 |
|
19 |
Return
|
20 |
------
|
|
|
3 |
import time
|
4 |
from transformers import set_seed, pipeline
|
5 |
|
6 |
+
device = 0 if torch.cuda.is_available() else "cpu"
|
7 |
|
8 |
+
|
9 |
+
def goai_tts(texte):
|
10 |
"""
|
11 |
Pour un texte donné, donner le speech en Mooré correspondant
|
12 |
|
|
|
14 |
----------
|
15 |
texte: str
|
16 |
Le texte écrit.
|
|
|
|
|
|
|
17 |
|
18 |
Return
|
19 |
------
|