gabrielwithhappy commited on
Commit
0e601b6
โ€ข
1 Parent(s): a52d27e

remove crawling link limit

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -9,8 +9,8 @@ import re
9
 
10
  from bs4 import BeautifulSoup as bs
11
  import requests
12
-
13
  from transformers import PreTrainedTokenizerFast, BartForConditionalGeneration
 
14
  # Load Model and Tokenize
15
  def get_summary(input_text):
16
  tokenizer = PreTrainedTokenizerFast.from_pretrained("ainize/kobart-news")
@@ -54,7 +54,7 @@ class news_collector:
54
  links = [item.attrs['href'] for item in news_titles ]
55
  https_links = [item for item in links if item.startswith('https') == True]
56
  https_links
57
- return https_links[:2]
58
 
59
 
60
  def update_news_examples(self):
@@ -94,14 +94,6 @@ with gr.Blocks() as demo:
94
  inputs = gr.Textbox( placeholder="๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”." ),
95
  examples=news.examples)
96
 
97
- # gr.Examples(
98
- # examples=[
99
- # ["images/demo1.jpg"],
100
- # ["images/demo2.jpg"],
101
- # ["images/demo4.jpg"],
102
- # ],
103
-
104
-
105
 
106
 
107
  if __name__ == "__main__":
 
9
 
10
  from bs4 import BeautifulSoup as bs
11
  import requests
 
12
  from transformers import PreTrainedTokenizerFast, BartForConditionalGeneration
13
+
14
  # Load Model and Tokenize
15
  def get_summary(input_text):
16
  tokenizer = PreTrainedTokenizerFast.from_pretrained("ainize/kobart-news")
 
54
  links = [item.attrs['href'] for item in news_titles ]
55
  https_links = [item for item in links if item.startswith('https') == True]
56
  https_links
57
+ return https_links
58
 
59
 
60
  def update_news_examples(self):
 
94
  inputs = gr.Textbox( placeholder="๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”." ),
95
  examples=news.examples)
96
 
 
 
 
 
 
 
 
 
97
 
98
 
99
  if __name__ == "__main__":