Here is the code for the script
import os
from apikey import api_key
from langchain.llms import HuggingFaceHub
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain, SequentialChain
Environment Variables
os.environ[‘HUGGINGFACEHUB_API_TOKEN’] = api_key
LLM
llm = HuggingFaceHub(repo_id=‘google/flan-t5-xl’, model_kwargs={‘temperature’: 0.9,
‘max_length’: 100})
prompt = “What is the capital of India?”
response = llm(prompt)
print(response)