mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-10-30 19:33:43 +08:00
feat: refactor finalize_middle_json to support server-side post-processing and enhance title leveling
This commit is contained in:
@@ -989,7 +989,8 @@ async def aio_doc_analyze(
|
||||
)
|
||||
|
||||
if client_side_output_generation:
|
||||
apply_server_side_postprocess(
|
||||
await asyncio.to_thread(
|
||||
apply_server_side_postprocess,
|
||||
middle_json["pdf_info"],
|
||||
hybrid_pipeline_model,
|
||||
_ocr_enable,
|
||||
|
||||
@@ -820,7 +820,11 @@ async def run_planned_task(
|
||||
parse_method,
|
||||
is_office=document.suffix in office_suffixes,
|
||||
)
|
||||
regenerate_client_side_outputs(parse_dir, document.stem)
|
||||
await asyncio.to_thread(
|
||||
regenerate_client_side_outputs,
|
||||
parse_dir,
|
||||
document.stem,
|
||||
)
|
||||
completed_tasks, completed_pages = await mark_task_completed(
|
||||
progress,
|
||||
planned_task.total_pages,
|
||||
|
||||
@@ -1073,8 +1073,9 @@ async def _run_to_markdown_job(
|
||||
parse_method,
|
||||
allow_office_fallback=True,
|
||||
)
|
||||
emit_status(STATUS_PROCESSING_OUTPUT)
|
||||
if use_client_side_output_generation:
|
||||
regenerate_client_side_outputs(local_md_dir, file_name)
|
||||
await asyncio.to_thread(regenerate_client_side_outputs, local_md_dir, file_name)
|
||||
|
||||
preview_pdf_path = maybe_generate_local_preview(
|
||||
extract_root=extract_root,
|
||||
@@ -1084,7 +1085,6 @@ async def _run_to_markdown_job(
|
||||
parse_method=parse_method,
|
||||
)
|
||||
|
||||
emit_status(STATUS_PROCESSING_OUTPUT)
|
||||
zip_archive_success = compress_directory_to_zip(local_md_dir, archive_zip_path)
|
||||
if zip_archive_success == 0:
|
||||
logger.info('Compression successful')
|
||||
|
||||
Reference in New Issue
Block a user