Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
|