RESTRA / app.py
Adriiiii24's picture
Create app.py
656bd99 verified
raw
history blame
421 Bytes
import gradio as gr
from transformers import pipeline
summarizer = pipeline("summarization", model="sumedh/t5-base-amazonreviews")
def texto_sum(text):
summary = summarizer(text, do_sample=False)
return summary[0]['summary_text']
demo = gr.Interface(
fn=texto_sum,
inputs=gr.Textbox(label="Texto a introducir:", placeholder="Introduce el texto a resumir aquí..."),
outputs="text"
)
demo.launch()