File size: 663 Bytes
219651a
 
 
 
 
 
 
 
 
 
 
 
1863c16
4e6078d
848f7d8
219651a
 
 
4e6078d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from transformers import pipeline

pipeline = pipeline(task="summarization", model="dross20/summarization_model")

def predict(input_text):
    predictions = pipeline(input_text)
    return predictions[0]['summary_text']

gradio_app = gr.Interface(
    predict,
    inputs = gr.Textbox(label="Enter text to be summarized"),
    outputs = gr.Textbox(label="Summarized text"),
    title="Text Summarizer",
    description="This application performs text summarization using a T5 model fined-tuned on a summarization dataset. Note that this application often takes 30 or more seconds to run."
)

if __name__ == "__main__":
    gradio_app.launch()