Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import scipy
|
| 3 |
+
|
| 4 |
+
synthesiser = pipeline("text-to-speech", "suno/bark")
|
| 5 |
+
|
| 6 |
+
speech = synthesiser("Hello, my dog is cooler than you!", forward_params={"do_sample": True})
|
| 7 |
+
|
| 8 |
+
scipy.io.wavfile.write("bark_out.wav", rate=speech["sampling_rate"], data=speech["audio"])
|