Falcon7B / app.py
sudhir2016's picture
Create app.py
51ceb3f
raw
history blame contribute delete
526 Bytes
import gradio as gr
from langchain import PromptTemplate, HuggingFaceHub, LLMChain
llm=HuggingFaceHub(repo_id="tiiuae/falcon-7b")
template = 'question:{question}'
prompt = PromptTemplate(template=template, input_variables=["question"])
chain = LLMChain(llm=llm, prompt=prompt)
def answer(question):
out=chain.run(question)
out=chain.run(question)
out1= out.splitlines()
out2=out1[1]
return out2
demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples= [['What is the capital of India ?']])
demo.launch()