king007 commited on
Commit
792832a
1 Parent(s): b92fdf9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -115,8 +115,11 @@ class SemanticSearch:
115
  def load_recommender(path, start_page=1):
116
  global recommender
117
  texts, pdf_parse_status = pdf_to_text(path, start_page=start_page)
118
- chunks = text_to_chunks(texts, start_page=start_page)
119
- recommender.fit(chunks)
 
 
 
120
  return 'Corpus Loaded.', pdf_parse_status
121
 
122
 
 
115
  def load_recommender(path, start_page=1):
116
  global recommender
117
  texts, pdf_parse_status = pdf_to_text(path, start_page=start_page)
118
+ if pdf_parse_status == 0:
119
+ return 'file too large.', pdf_parse_status
120
+ else:
121
+ chunks = text_to_chunks(texts, start_page=start_page)
122
+ recommender.fit(chunks)
123
  return 'Corpus Loaded.', pdf_parse_status
124
 
125