mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-14 05:56:40 +00:00
Beam (#4996)
# Beam Calls the Beam API wrapper to deploy and make subsequent calls to an instance of the gpt2 LLM in a cloud deployment. Requires installation of the Beam library and registration of Beam Client ID and Client Secret. Additional calls can then be made through the instance of the large language model in your code or by calling the Beam API. --------- Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
This commit is contained in:
29
tests/integration_tests/llms/test_beam.py
Normal file
29
tests/integration_tests/llms/test_beam.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Test Beam API wrapper."""
|
||||
|
||||
from langchain.llms.beam import Beam
|
||||
|
||||
|
||||
def test_beam_call() -> None:
|
||||
"""Test valid call to Beam."""
|
||||
llm = Beam(
|
||||
model_name="gpt2",
|
||||
name="langchain-gpt2",
|
||||
cpu=8,
|
||||
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)
|
Reference in New Issue
Block a user