Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
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"] | |
def greet(name): | |
return "Hello " + name + "!!" | |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
iface = gr.Interface(fn=translate, inputs=gr.inputs.Textbox(lines=10, placeholder="Enter text to summarize..."), | |
outputs="text") | |
iface.launch() |