Files
langchain/docs/examples/integrations/huggingface_hub.ipynb

1.6 KiB

HuggingFace Hub

This example showcases how to connect to the HuggingFace Hub.

In [1]:
from langchain import PromptTemplate, HuggingFaceHub, LLMChain

template = """Question: {question}

Answer: Let's think step by step."""
prompt = PromptTemplate(template=template, input_variables=["question"])
llm_chain = LLMChain(prompt=prompt, llm=HuggingFaceHub(repo_id="google/flan-t5-xl", model_kwargs={"temperature":1e-10}))

question = "What NFL team won the Super Bowl in the year Justin Beiber was born?"

print(llm_chain.run(question))
The Seattle Seahawks won the Super Bowl in 2010. Justin Beiber was born in 2010. The
In [ ]: