mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 03:15:19 +03:00
- Updated `langchain/docs/modules/models/llms/integrations/` notebooks: added links to the original sites, the install information, etc. - Added the `nlpcloud` notebook. - Removed "Example" from Titles of some notebooks, so all notebook titles are consistent.
3.5 KiB
3.5 KiB
In [ ]:
!pip install modal-clientIn [2]:
# register and get a new token
!modal token new[?25lLaunching login page in your browser window[33m...[0m [2KIf this is not showing up, please copy this URL into your web browser manually: [2Km⠙[0m Waiting for authentication in the web browser... ]8;id=417802;https://modal.com/token-flow/tf-ptEuGecm7T1T5YQe42kwM1\[4;94mhttps://modal.com/token-flow/tf-ptEuGecm7T1T5YQe42kwM1[0m]8;;\ [2K[32m⠙[0m Waiting for authentication in the web browser... [1A[2K^C [31mAborted.[0m
In [ ]:
from langchain.llms import Modal
from langchain import PromptTemplate, LLMChainIn [ ]:
template = """Question: {question}
Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])In [ ]:
llm = Modal(endpoint_url="YOUR_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)