testsequences.py
1 """ 2 Sequences module tests 3 """ 4 5 import unittest 6 7 from txtai.pipeline import Sequences 8 9 10 class TestSequences(unittest.TestCase): 11 """ 12 Sequences tests. 13 """ 14 15 def testGeneration(self): 16 """ 17 Test text2text pipeline generation 18 """ 19 20 model = Sequences("t5-small") 21 self.assertEqual(model("Testing the model", prefix="translate English to German: "), "Das Modell zu testen")