Files
neuml--txtai/test/python/testpipeline/testaudio/testtexttoaudio.py
T
wehub-resource-sync 3a7c47b2a6
build / build (macos-latest) (push) Waiting to run
build / build (ubuntu-latest) (push) Waiting to run
build / build (windows-latest) (push) Waiting to run
minimal / deploy (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:38:00 +08:00

27 lines
528 B
Python

"""
TextToAudio module tests
"""
import unittest
from txtai.pipeline import TextToAudio
class TestTextToAudio(unittest.TestCase):
"""
TextToAudio tests.
"""
def testTextToAudio(self):
"""
Test generating audio for text
"""
tta = TextToAudio("hf-internal-testing/tiny-random-MusicgenForConditionalGeneration")
# Check that data is generated
audio, rate = tta("This is a test")
self.assertGreater(len(audio), 0)
self.assertEqual(rate, 24000)