LangChain / app.py
sudhir2016's picture
Update app.py
4eb4270
raw
history blame
471 Bytes
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()