TomCallan commited on
Commit
ce85191
·
1 Parent(s): a4f4d5f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from transformers import pipeline
4
+
5
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
6
+
7
+ def f(x):
8
+ return summarizer(x, max_length=160, min_length=40, do_sample=False)[0]['summary_text']
9
+
10
+ iface = gr.Interface(fn=f, inputs="text", outputs="text")
11
+ iface.launch(share=True)