pace-demo / app.py
AngeloTb's picture
Update app.py
6ff9251 verified
raw
history blame contribute delete
571 Bytes
from transformers import pipeline
import gradio as gr
summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-small", truncation=True)
def traslate(text):
text = text.replace('"', '"')
text = text.replace(''', "'")
text = text.replace('&', "&")
result = summarizer(text, min_length=180, truncation=True)
return result[0]["summary_text"]
iface = gr.Interface(
fn=traslate,
inputs=gr.Textbox(lines=10, placeholder="Enter text to summarize here please..."),
outputs=gr.Textbox()
)
iface.launch()