File size: 675 Bytes
7248d39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Smoke test for Modal-backed LLM."""

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).parent.parent))

from models.llm import MiniCPMLLM


def main():
    print("Calling Modal LLM (first call may take ~1 min for cold start)...")
    llm = MiniCPMLLM()
    tokens = list(
        llm.stream_answer(
            "What is EBITDA?",
            "EBITDA stands for Earnings Before Interest, Taxes, Depreciation, and Amortization.",
        )
    )
    answer = "".join(tokens)
    print(f"Answer: {answer[:200]}...")
    assert len(answer) > 0, "LLM returned empty response"
    print("Modal LLM test passed.")


if __name__ == "__main__":
    main()