Spaces:
Sleeping
Sleeping
Using gr.Interface() instead of Series() seems to be deprecated
Browse files
app.py
CHANGED
@@ -5,8 +5,6 @@ nltk.download('punkt')
|
|
5 |
|
6 |
from transformers import pipeline
|
7 |
import gradio as gr
|
8 |
-
from gradio.mix import Parallel, Series
|
9 |
-
|
10 |
|
11 |
def extract_article_text(url):
|
12 |
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0'
|
@@ -33,15 +31,18 @@ desc = '''
|
|
33 |
This summarizer uses bart-large-cnn model by Facebook
|
34 |
'''
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
5 |
|
6 |
from transformers import pipeline
|
7 |
import gradio as gr
|
|
|
|
|
8 |
|
9 |
def extract_article_text(url):
|
10 |
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0'
|
|
|
31 |
This summarizer uses bart-large-cnn model by Facebook
|
32 |
'''
|
33 |
|
34 |
+
demo = gr.Interface (
|
35 |
+
extractor,
|
36 |
+
summarizer,
|
37 |
+
inputs = gr.Textbox(
|
38 |
+
lines = 2,
|
39 |
+
label = 'URL'
|
40 |
+
),
|
41 |
+
outputs = 'text',
|
42 |
+
title = 'News Summarizer',
|
43 |
+
theme = 'huggingface',
|
44 |
+
description = desc,
|
45 |
+
examples=sample_url
|
46 |
+
)
|
47 |
+
|
48 |
+
demo.launch()
|