Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
π fix env variable name
Browse filesSigned-off-by: peter szemraj <[email protected]>
app.py
CHANGED
@@ -305,7 +305,7 @@ def load_single_example_text(
|
|
305 |
text = clean(raw_text, lower=False)
|
306 |
elif full_ex_path.suffix == ".pdf":
|
307 |
logging.info(f"Loading PDF file {full_ex_path}")
|
308 |
-
max_pages = int(os.environ.get("
|
309 |
logging.info(f"max_pages set to: {max_pages}")
|
310 |
conversion_stats = convert_PDF_to_Text(
|
311 |
full_ex_path,
|
@@ -343,7 +343,7 @@ def load_uploaded_file(file_obj, max_pages: int = 20, lower: bool = False) -> st
|
|
343 |
text = clean(raw_text, lower=lower)
|
344 |
elif file_path.suffix == ".pdf":
|
345 |
logger.info(f"loading a PDF file: {file_path.name}")
|
346 |
-
max_pages = int(os.environ.get("
|
347 |
logger.info(f"max_pages is: {max_pages}. Starting conversion...")
|
348 |
conversion_stats = convert_PDF_to_Text(
|
349 |
file_path,
|
|
|
305 |
text = clean(raw_text, lower=False)
|
306 |
elif full_ex_path.suffix == ".pdf":
|
307 |
logging.info(f"Loading PDF file {full_ex_path}")
|
308 |
+
max_pages = int(os.environ.get("APP_OCR_MAX_PAGES", max_pages))
|
309 |
logging.info(f"max_pages set to: {max_pages}")
|
310 |
conversion_stats = convert_PDF_to_Text(
|
311 |
full_ex_path,
|
|
|
343 |
text = clean(raw_text, lower=lower)
|
344 |
elif file_path.suffix == ".pdf":
|
345 |
logger.info(f"loading a PDF file: {file_path.name}")
|
346 |
+
max_pages = int(os.environ.get("APP_OCR_MAX_PAGES", max_pages))
|
347 |
logger.info(f"max_pages is: {max_pages}. Starting conversion...")
|
348 |
conversion_stats = convert_PDF_to_Text(
|
349 |
file_path,
|