import os os.system('pip install gradio==2.3.0a0') import model as st_model import gradio as gr model = st_model.summarizer() def inference(text): documents = [text] return model.summarize(documents)[0] title = "SummerTime" description = "Gradio demo for SummerTime: An open-source text summarization toolkit for non-experts. To use it, simply add your text, or click one of the examples to load them. Read more at the links below." article = "
SummerTime: Text Summarization Toolkit for Non-experts | Github Repo
" gr.Interface( inference, [gr.inputs.Textbox(label="Input", lines=20)], gr.outputs.Textbox(label="Output"), title=title, description=description, article=article, examples=[["""PG&E stated it scheduled the blackouts in response to forecasts for high winds amid dry conditions.The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow."""]] ).launch(debug=True)