Spaces:
Build error
Build error
File size: 1,206 Bytes
a64d3c8 e8343f6 e7b6fd5 a0f867c 5a176c8 b19937b a0f867c 5a176c8 a0f867c 5a176c8 61d5e68 a0f867c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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 = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.12738' target='_blank'>SummerTime: Text Summarization Toolkit for Non-experts</a> | <a href='https://github.com/Yale-LILY/SummerTime' target='_blank'>Github Repo</a></p>"
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) |