feat: refactor finalize_middle_json to support server-side post-processing and enhance title leveling

This commit is contained in:
myhloli
2026-05-27 23:19:24 +08:00
parent 0acd7903ee
commit 4bae02c295
3 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -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,
+5 -1
View File
@@ -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,
+2 -2
View File
@@ -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')