taprosoft
commited on
Commit
·
35b6a38
1
Parent(s):
540678d
fix: update env vars
Browse files
app.py
CHANGED
@@ -33,7 +33,8 @@ from utils import remove_images_from_markdown, trim_pages
|
|
33 |
TRIMMED_PDF_PATH = Path("/tmp/trimmed_input")
|
34 |
TRIMMED_PDF_PATH.mkdir(exist_ok=True)
|
35 |
DO_WARMUP = os.getenv("DO_WARMUP", "True").lower() == "true"
|
36 |
-
MAX_SELECTED_METHODS =
|
|
|
37 |
|
38 |
|
39 |
def convert_document(path, method, start_page=0, enabled=True):
|
@@ -49,6 +50,7 @@ def convert_document(path, method, start_page=0, enabled=True):
|
|
49 |
path,
|
50 |
output_path=TRIMMED_PDF_PATH,
|
51 |
start_page=start_page,
|
|
|
52 |
)
|
53 |
file_name = Path(path).stem
|
54 |
debug_image_paths = []
|
|
|
33 |
TRIMMED_PDF_PATH = Path("/tmp/trimmed_input")
|
34 |
TRIMMED_PDF_PATH.mkdir(exist_ok=True)
|
35 |
DO_WARMUP = os.getenv("DO_WARMUP", "True").lower() == "true"
|
36 |
+
MAX_SELECTED_METHODS = int(os.getenv("MAX_SELECTED_METHODS", "6"))
|
37 |
+
MAX_PAGES = int(os.getenv("MAX_PAGES", "5"))
|
38 |
|
39 |
|
40 |
def convert_document(path, method, start_page=0, enabled=True):
|
|
|
50 |
path,
|
51 |
output_path=TRIMMED_PDF_PATH,
|
52 |
start_page=start_page,
|
53 |
+
trim_pages=MAX_PAGES,
|
54 |
)
|
55 |
file_name = Path(path).stem
|
56 |
debug_image_paths = []
|