File size: 475 Bytes
a1f8773
6455886
573d720
6d0cc0a
573d720
 
 
 
 
 
2f9181e
573d720
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gradio
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()