File size: 539 Bytes
fe3f85c
 
2556944
 
358f775
fe3f85c
ec716b2
358f775
 
 
f72dedb
2556944
 
 
 
 
 
 
 
fe3f85c
358f775
3124816
3537b2b
 
 
 
 
3124816
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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__'