Spaces:
Sleeping
Sleeping
File size: 482 Bytes
fe3f85c 2556944 fe3f85c ec716b2 2556944 fe3f85c 2556944 fe3f85c 2556944 3124816 2556944 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 |
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)
demo.launch()
|