File size: 568 Bytes
0fee200
6423313
d6bb89e
0fee200
d6bb89e
 
 
 
0fee200
 
 
d6bb89e
 
 
 
5d9d655
0fee200
 
 
d6bb89e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from transformers import pipeline
import gradio as gr 

pipe = pipeline("summarization", model="ayoubkirouane/T5-4-Summarization")

def summarization(text):
    return pipe(text)[0]["summary_text"]

# Create a Gradio interface
iface = gr.Interface(
    fn=summarization,
    inputs=gr.Textbox(label="Input Text"),
    outputs=gr.Textbox(label="Generated Summary"),
    allow_flagging=False,
    title="T5-4-Summarization",
    description="This app generates a summary of the input text using T5 fine-tuned model.",
)

# Launch the Gradio app
iface.launch(debug=True)