File size: 462 Bytes
34a3a0c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
## 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) |