Spaces:
Runtime error
Runtime error
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() |