File size: 695 Bytes
692d676 e7ea3a0 b27912e 12b455d b27912e 20e45cb b27912e e7ea3a0 b27912e 29a41b3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
from transformers import pipeline
get_completion = pipeline("summarization", model="Falconsai/text_summarization")
def summarize(input):
output = get_completion(input)
return output[0]['summary_text']
with gr.Blocks() as demo:
gr.Markdown("# The following summarisation is done with the Falconsai model")
with gr.Row():
with gr.Column(min_width=900):
inputs = gr.Textbox(label="Text to summarize", lines=6)
btn = gr.Button("Submit") #Submit button
outputs = gr.Textbox(label="Result", lines=3)
btn.click(fn=summarize, inputs=[inputs], outputs=[outputs])
gr.close_all()
demo.launch(share=True) |