AICERTsplus commited on
Commit
b52f8c8
·
verified ·
1 Parent(s): 8c69952

Update app.py

Browse files

Initial deployment

Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,7 +1,21 @@
 
1
  import gradio as gr
2
 
3
- demo = gr.Interface.load(
4
- "huggingface/facebook/bart-large-cnn"
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  )
6
 
7
  demo.launch()
 
1
+ from transformers import pipeline
2
  import gradio as gr
3
 
4
+ summarizer = pipeline(
5
+ "summarization",
6
+ model="facebook/bart-large-cnn"
7
+ )
8
+
9
+ demo = gr.Interface(
10
+ fn=lambda text: summarizer(text)[0]["summary_text"],
11
+ inputs=gr.Textbox(
12
+ lines=10,
13
+ label="Enter Text"
14
+ ),
15
+ outputs=gr.Textbox(
16
+ label="Summary"
17
+ ),
18
+ title="Text Summarizer Demo"
19
  )
20
 
21
  demo.launch()