File size: 439 Bytes
77fb0a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

import gradio as GUI
from transformers import pipeline
from ..services.text_summarize_service import completion_message

completion_message = pipeline("summarization", model='facebook/bart-large-cnn')


def summarize(input):
    output = completion_message(input)
    return output[0]['summary_text']
    
def loadGUI():
    GUI.close_all()
    demo = GUI.Interface(fn=summarize, inputs="text", outputs="text")
    demo.launch(share=True)