import gradio as gr from langchain import PromptTemplate, HuggingFaceHub, LLMChain import os llm=HuggingFaceHub(repo_id="google/flan-t5-xxl") template = 'question:{question}' prompt = PromptTemplate(template=template, input_variables=["question"]) chain = LLMChain(llm=llm, prompt=prompt) def answer(question): out=chain.run(question) return out demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples= [['What is the capital of India ?']]) demo.launch()