mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-05 09:25:14 +03:00
### Description renamed several repository links from `hwchase17` to `langchain-ai`. ### Why I discovered that the README file in the devcontainer contains an old repository name, so I took the opportunity to rename the old repository name in all files within the repository, excluding those that do not require changes. ### Dependencies none ### Tag maintainer @baskaryan ### Twitter handle [kzk_maeda](https://twitter.com/kzk_maeda)
5.2 KiB
5.2 KiB
In [ ]:
!pip install modalIn [2]:
# Register an account with Modal and get a new token.
!modal token newLaunching login page in your browser window... If this is not showing up, please copy this URL into your web browser manually: https://modal.com/token-flow/tf-Dzm3Y01234mqmm1234Vcu3
In [ ]:
from langchain.llms import Modal
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChainIn [ ]:
template = """Question: {question}
Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])In [ ]:
endpoint_url = "https://ecorp--custom-llm-endpoint.modal.run" # REPLACE ME with your deployed Modal web endpoint's URL
llm = Modal(endpoint_url=endpoint_url)In [ ]:
llm_chain = LLMChain(prompt=prompt, llm=llm)In [ ]:
question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"
llm_chain.run(question)