ayoubkirouane's picture
Update app.py
6423313
raw
history blame
481 Bytes
# 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)