dummyS / app.py
Robin19's picture
Create app.py
34a3a0c verified
raw
history blame contribute delete
462 Bytes
## suppress warnings
from transformers.utils import logging
logging.set_verbosity_error()
import warnings
warnings.filterwarnings("ignore")
from transformers import pipeline
pipe = pipeline(task = "summarization", model = "Falconsai/text_summarization")
def summarize(input_text) :
op = pipe(input_text)
return op[0]['summary_text']
import gradio as gr
iface = gr.Interface(fn = summarize, inputs = "text", outputs = "text")
iface.launch(share = True)