mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 19:35:20 +03:00
3.8 KiB
3.8 KiB
In [ ]:
!pip install openllmIn [ ]:
from langchain.llms import OpenLLM
server_url = "http://localhost:3000" # Replace with remote host if you are running on a remote server
llm = OpenLLM(server_url=server_url)In [ ]:
from langchain.llms import OpenLLM
llm = OpenLLM(
model_name="dolly-v2",
model_id="databricks/dolly-v2-3b",
temperature=0.94,
repetition_penalty=1.2,
)In [11]:
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
template = "What is a good name for a company that makes {product}?"
prompt = PromptTemplate(template=template, input_variables=["product"])
llm_chain = LLMChain(prompt=prompt, llm=llm)
generated = llm_chain.run(product="mechanical keyboard")
print(generated)iLkb
In [ ]: