File size: 613 Bytes
e083233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import torch
import gradio as gr
from transformers import pipeline
from pathlib import Path
from transformers import pipeline

from transformers import pipeline

text_summary = pipeline("text-generation", model="sshleifer/t5-base-cnn")

def summary(input):
    output = text_summary(input)
    return output[0]['summary_text']

gr.close_all()

demo=gr.Interface(fn=summary, inputs=[gr.Textbox(label="Input Text to Summarize", lines=6)], outputs=[gr.Textbox(label="Summarized Text", lines=4)], title="Project1 : Text Summarizer", description="This application will be used to summarize the text")
demo.launch()