ksvmuralidhar commited on
Commit
6b0c0e0
1 Parent(s): c3657ca

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +2 -2
api.py CHANGED
@@ -78,7 +78,7 @@ async def summ_inference(txts: str):
78
  # logging.warning('Exiting scrape_multi_process()')
79
  # return scraped_texts
80
 
81
- def scrape_urls(urls):
82
  scraped_texts = []
83
  scrape_errors = []
84
  for url in urls:
@@ -116,7 +116,7 @@ async def read_items(q: URLList):
116
  urls = request_json['urls']
117
  api_key = request_json['key']
118
  _ = authenticate_key(api_key)
119
- scraped_texts, scrape_errors = scrape_urls(urls)
120
  summaries = await summ_inference(scraped_texts)
121
  status_code = 200
122
  response_json = {'urls': urls, 'scraped_texts': scraped_texts, 'scrape_errors': scrape_errors, 'summaries': summaries, 'summarizer_error': ''}
 
78
  # logging.warning('Exiting scrape_multi_process()')
79
  # return scraped_texts
80
 
81
+ async def scrape_urls(urls):
82
  scraped_texts = []
83
  scrape_errors = []
84
  for url in urls:
 
116
  urls = request_json['urls']
117
  api_key = request_json['key']
118
  _ = authenticate_key(api_key)
119
+ scraped_texts, scrape_errors = await scrape_urls(urls)
120
  summaries = await summ_inference(scraped_texts)
121
  status_code = 200
122
  response_json = {'urls': urls, 'scraped_texts': scraped_texts, 'scrape_errors': scrape_errors, 'summaries': summaries, 'summarizer_error': ''}