import gradio as gr from src.TextSummarizer.pipeline.prediction import PredictionPipeline def predict(document): """ Method will take the document and summarize it. """ # predict the summary using my own pre-trained model. summary = PredictionPipeline().predict(document) return summary # Create the frontend. input_interfaces: list = [] with gr.Blocks(theme=gr.themes.Soft()) as app: with gr.Row(): gr.Label("Text Summarizer...") with gr.Row(): gr.Markdown("Type in your document which you wanna summarize...") with gr.Row(): with gr.Column(): gr.Label("gonna be the input box") with gr.Column(): gr.Label("gonna be the output box") app.launch()