import gradio as gr g=open('test.txt') g1=g.read() def answer(query): out=g1 return out demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['song celestial']]) demo.launch()