MKhan24 commited on
Commit
32e1c19
·
1 Parent(s): 62e789f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -1,17 +1,8 @@
1
- !pip install gradio transformers
2
-
3
  from transformers import pipeline
4
-
5
- model_name = "https://huggingface.co/slauw87/bart_summarisation"
6
- model = pipeline(task="summarization", model=model_name)
7
-
8
  import gradio as gr
9
 
10
- def classify_text(text):
11
- result = model(text)
12
- return result[0]['label']
13
-
14
- iface = gr.Interface(fn=classify_text, inputs="text", outputs="text")
15
 
16
- iface.launch()
 
17
 
 
 
 
1
  from transformers import pipeline
 
 
 
 
2
  import gradio as gr
3
 
4
+ pipe = pipeline("summarization", model="slauw87/bart_summarisation")
 
 
 
 
5
 
6
+ demo = gr.Interface.from_pipeline(pipe)
7
+ demo.launch()
8