lampongyuen commited on
Commit
ceef65d
·
1 Parent(s): 77b7c7d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ get_completion = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
5
+
6
+ def summarize(input):
7
+ output = get_completion(input)
8
+ return output[0]['summary_text']
9
+
10
+ gr.close_all()
11
+ demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
12
+ demo.launch(share=True)