mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
481d3855dc
- `llm(prompt)` -> `llm.invoke(prompt)` - `llm(prompt=prompt` -> `llm.invoke(prompt)` (same with `messages=`) - `llm(prompt, callbacks=callbacks)` -> `llm.invoke(prompt, config={"callbacks": callbacks})` - `llm(prompt, **kwargs)` -> `llm.invoke(prompt, **kwargs)`
18 lines
529 B
Python
18 lines
529 B
Python
"""Test DeepSparse wrapper."""
|
|
from langchain_community.llms import DeepSparse
|
|
|
|
|
|
def test_deepsparse_call() -> None:
|
|
"""Test valid call to DeepSparse."""
|
|
config = {"max_generated_tokens": 5, "use_deepsparse_cache": False}
|
|
|
|
llm = DeepSparse(
|
|
model="zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base-none",
|
|
config=config,
|
|
)
|
|
|
|
output = llm.invoke("def ")
|
|
assert isinstance(output, str)
|
|
assert len(output) > 1
|
|
assert output == "ids_to_names"
|