langchain/libs/community/tests/integration_tests/llms/test_beam.py
Eugene Yurtsev 25fbe356b4
community[patch]: upgrade to recent version of mypy (#21616)
This PR upgrades community to a recent version of mypy. It inserts type:
ignore on all existing failures.
2024-05-13 14:55:07 -04:00

30 lines
693 B
Python

"""Test Beam API wrapper."""
from langchain_community.llms.beam import Beam
def test_beam_call() -> None:
"""Test valid call to Beam."""
llm = Beam(
model_name="gpt2",
name="langchain-gpt2",
cpu=8, # type: ignore[arg-type]
memory="32Gi",
gpu="A10G",
python_version="python3.8",
python_packages=[
"diffusers[torch]>=0.10",
"transformers",
"torch",
"pillow",
"accelerate",
"safetensors",
"xformers",
],
max_length="5",
)
llm._deploy()
output = llm._call("Your prompt goes here")
assert isinstance(output, str)