Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
gr.close_all()
|
| 3 |
+
|
| 4 |
+
def summarize(input):
|
| 5 |
+
output = get_completion(input)
|
| 6 |
+
return output[0]['summary_text']
|
| 7 |
+
|
| 8 |
+
gr.close_all()
|
| 9 |
+
demo = gr.Interface(fn=summarize,
|
| 10 |
+
# inputs=[gr.Textbox(label="Text to summarize", lines=6)],
|
| 11 |
+
# outputs=[gr.Textbox(label="Result", lines=3)],
|
| 12 |
+
# title="Text summarization with distilbart-cnn",
|
| 13 |
+
# description="Summarize any text using the `shleifer/distilbart-cnn-12-6` model under the hood!"
|
| 14 |
+
inputs=[gr.Textbox(label="What do you want summarize !", lines=6)],
|
| 15 |
+
outputs=[gr.Textbox(label="Magic Summarization !!!", lines=3)],
|
| 16 |
+
title="Text summarization test and demo app by Srinivas.V ..",
|
| 17 |
+
description="Summarize any text",
|
| 18 |
+
allow_flagging="never"
|
| 19 |
+
)
|
| 20 |
+
demo.launch(share=True)
|