Spaces:
Running
Running
Yurii Paniv
commited on
Commit
•
9ddc3f7
1
Parent(s):
6edda28
Add TTS tests
Browse files- tests/test_tts.py +10 -0
tests/test_tts.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from ukrainian_tts.tts import TTS, Voices, Stress
|
2 |
+
from io import BytesIO
|
3 |
+
|
4 |
+
def test_tts():
|
5 |
+
tts = TTS(use_cuda=False)
|
6 |
+
file = BytesIO()
|
7 |
+
_, text = tts.tts("Привіт", Voices.Dmytro.value, Stress.Dictionary.value, file)
|
8 |
+
file.seek(0)
|
9 |
+
assert text == "Прив+іт"
|
10 |
+
assert file.getbuffer().nbytes > 1000 # check that file was generated
|