NLPShowCase / app.py
Jayanthi's picture
Use google model
6c33ed3
Raw History Blame Contribute Delete
467 Bytes
import gradio as gr
from transformers import pipeline
#Summarize
def greet(name):
return "Hello "+name + " abc"
#get_completion = pipeline('summarization',model='sshleifer/distilbart-cnn-12-6')
get_completion = pipeline('summarization',model='google/flan-t5-base')
def summarize(input):
output = get_completion(input)
return "Summary : " + output[0]['summary_text']
iface = gr.Interface(fn=summarize, inputs = "text",outputs='text')
iface.launch()