Spaces:
Runtime error
Runtime error
Update goai_tts.py
Browse files- goai_tts.py +3 -1
goai_tts.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import torch
|
2 |
import scipy
|
3 |
import time
|
|
|
4 |
from transformers import set_seed, pipeline
|
5 |
|
6 |
device = 0 if torch.cuda.is_available() else "cpu"
|
@@ -34,4 +35,5 @@ def goai_tts(texte):
|
|
34 |
wavfile = scipy.io.wavfile.write("finetuned_output.wav", rate=speech["sampling_rate"], data=speech["audio"][0])
|
35 |
|
36 |
print("Temps écoulé: ", int(time.time() - start_time), " secondes")
|
37 |
-
|
|
|
|
1 |
import torch
|
2 |
import scipy
|
3 |
import time
|
4 |
+
import numpy as np
|
5 |
from transformers import set_seed, pipeline
|
6 |
|
7 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
35 |
wavfile = scipy.io.wavfile.write("finetuned_output.wav", rate=speech["sampling_rate"], data=speech["audio"][0])
|
36 |
|
37 |
print("Temps écoulé: ", int(time.time() - start_time), " secondes")
|
38 |
+
|
39 |
+
return np.array(wavfile[1], dtype=float)
|