mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-09-24 23:10:23 +08:00
fix: keep model output for client-side output generation
This commit is contained in:
@@ -161,7 +161,7 @@ async def parse_request_form(
|
||||
Form(
|
||||
description=(
|
||||
"Defer final markdown/content-list generation to the client. "
|
||||
"When enabled, the server returns staged middle JSON and images."
|
||||
"When enabled, the server returns staged middle JSON, model output, and images."
|
||||
),
|
||||
),
|
||||
] = False,
|
||||
@@ -188,7 +188,7 @@ async def parse_request_form(
|
||||
if client_side_output_generation:
|
||||
return_md = False
|
||||
return_middle_json = True
|
||||
return_model_output = False
|
||||
return_model_output = True
|
||||
return_content_list = False
|
||||
return_images = True
|
||||
|
||||
|
||||
@@ -626,9 +626,8 @@ def build_request_form_data(
|
||||
image_analysis: bool = True,
|
||||
client_side_output_generation: bool = False,
|
||||
) -> dict[str, str | list[str]]:
|
||||
# 开启客户端输出生成时,服务端只负责返回 middle json、图片和原文件。
|
||||
# 开启客户端输出生成时,只关闭客户端会重建的最终产物。
|
||||
return_md = not client_side_output_generation
|
||||
return_model_output = not client_side_output_generation
|
||||
return_content_list = not client_side_output_generation
|
||||
return _api_client.build_parse_request_form_data(
|
||||
lang_list=[lang],
|
||||
@@ -642,7 +641,7 @@ def build_request_form_data(
|
||||
end_page_id=end_page_id,
|
||||
return_md=return_md,
|
||||
return_middle_json=True,
|
||||
return_model_output=return_model_output,
|
||||
return_model_output=True,
|
||||
return_content_list=return_content_list,
|
||||
return_images=True,
|
||||
response_format_zip=True,
|
||||
|
||||
@@ -997,7 +997,7 @@ async def _run_to_markdown_job(
|
||||
end_page_id=end_pages - 1,
|
||||
return_md=not use_client_side_output_generation,
|
||||
return_middle_json=True,
|
||||
return_model_output=not use_client_side_output_generation,
|
||||
return_model_output=True,
|
||||
return_content_list=not use_client_side_output_generation,
|
||||
return_images=True,
|
||||
response_format_zip=True,
|
||||
|
||||
Reference in New Issue
Block a user