ganeshkamath89 commited on
Commit
d0eb069
·
verified ·
1 Parent(s): 9bee216

Using gr.Interface() instead of Series() seems to be deprecated

Browse files
Files changed (1) hide show
  1. app.py +15 -14
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
- iface = Series(extractor, summarizer,
37
- inputs = gr.inputs.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
- iface.launch()
 
 
 
 
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()