Spaces:
Runtime error
Runtime error
ashutoshzade
commited on
Commit
•
0f96ac0
1
Parent(s):
0c38857
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
def summarize(input):
|
3 |
output = get_completion(input)
|
4 |
return output[0]['summary_text']
|
5 |
-
|
6 |
gr.close_all()
|
7 |
-
demo = gr.Interface(fn=summarize,
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
demo.launch()
|
|
|
1 |
+
#import gradio as gr
|
2 |
+
#def summarize(input):
|
3 |
+
# output = get_completion(input)
|
4 |
+
# return output[0]['summary_text']
|
5 |
+
|
6 |
+
#gr.close_all()
|
7 |
+
#demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
|
8 |
+
#demo.launch(share=True, server_port=int(os.environ['PORT1']))
|
9 |
+
#demo.launch()
|
10 |
+
|
11 |
import gradio as gr
|
12 |
+
|
13 |
def summarize(input):
|
14 |
output = get_completion(input)
|
15 |
return output[0]['summary_text']
|
16 |
+
|
17 |
gr.close_all()
|
18 |
+
demo = gr.Interface(fn=summarize,
|
19 |
+
inputs=[gr.Textbox(label="Text to summarize", lines=6)],
|
20 |
+
outputs=[gr.Textbox(label="Result", lines=3)],
|
21 |
+
title="Text summarization with distilbart-cnn",
|
22 |
+
description="Summarize any text using the `shleifer/distilbart-cnn-12-6` model under the hood!"
|
23 |
+
)
|
24 |
+
#demo.launch(share=True, server_port=int(os.environ['PORT2']))
|
25 |
demo.launch()
|