Spaces:
Sleeping
Sleeping
| 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"] | |
| 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 = pred, inputs=input_text, outputs= output_text) | |
| if __name__=='__main__': | |
| demo.launch() | |
| # if __name__=='__main__' | |