space-demo-dj1 / app.py
DeclanJoyceEagle's picture
Update app.py
9ad70d2 verified
raw
history blame
587 Bytes
from transformers import pipeline
import gradio as gr
summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-small", truncation=True, framework="tf" )
def translate(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=translate,
inpute=gr.inputs.Textbox(lines=10,placeholder="Enter text to summarize..."),
outputs="text"
)
iface.launch()