File size: 481 Bytes
0fee200
 
6423313
0fee200
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Use a pipeline as a high-level helper
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(prompt="Input Text"),
    outputs=gr.Textbox(prompt="Generated Summary") , 
    allow_flagging=False
)

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