Files
neuml--txtai/test/python/testpipeline/testllm/testlitert.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

32 lines
745 B
Python

"""
LiteRT module tests
"""
import unittest
from txtai.pipeline import LLM
class TestLiteRT(unittest.TestCase):
"""
LiteRT tests.
"""
def testGeneration(self):
"""
Test generation with LiteRT
"""
# Test model generation with LiteRT
model = LLM("neuml/gemma-4-tiny-random-litert-lm/gemma-4-tiny-random.litertlm", mtp=False, maxlength=25)
# Test standard
self.assertIsNotNone(model("Hello"))
# Test streaming
self.assertIsNotNone(list(model("Hello", stream=True)))
# Test CPU fallback
model = LLM("neuml/gemma-4-tiny-random-litert-lm/gemma-4-tiny-random.litertlm", mtp=True, maxlength=25)
self.assertIsNotNone(model("Hello"))