Spaces:
Sleeping
Sleeping
Commit
·
671205b
1
Parent(s):
9c0b6a9
Update PDF to Markdown converter API with NVIDIA L4 support
Browse files
pdf_converter/convert_pdf_to_md.py
CHANGED
@@ -20,8 +20,11 @@ def convert_pdf(pdf_input_path, output_md_path=None):
|
|
20 |
print(f"Starting conversion of '{pdf_input_path}'...")
|
21 |
|
22 |
try:
|
|
|
|
|
|
|
23 |
# Convert the PDF to markdown using marker
|
24 |
-
markdown_text
|
25 |
|
26 |
# If output path is provided, save the markdown
|
27 |
if output_md_path:
|
|
|
20 |
print(f"Starting conversion of '{pdf_input_path}'...")
|
21 |
|
22 |
try:
|
23 |
+
# Use marker.Marker() for newer versions of marker-pdf
|
24 |
+
md_converter = marker.Marker()
|
25 |
+
|
26 |
# Convert the PDF to markdown using marker
|
27 |
+
markdown_text = md_converter.convert_file(pdf_input_path)
|
28 |
|
29 |
# If output path is provided, save the markdown
|
30 |
if output_md_path:
|