from transformers import pipeline import gradio as gr # pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") # def pred(input): # output = pipe_flan(input) # return output[0]["generated_text"] def test_fun(input): return input demo = gr.Blocks() with demo: with gr.Row(): input_text = gr.Textbox(label='Input Text',lines=5) b1 = gr.Button('Submit') output_text = gr.Textbox() b1.click(fn = test_fun, inputs=input_text, outputs= output_text) if __name__=='__main__': demo.launch() # if __name__=='__main__'