This commit is contained in:
2026-06-16 09:59:48 +08:00
parent e932b07fa6
commit 054962c9d8
+7 -5
View File
@@ -23,6 +23,11 @@ DEFAULT_LANG = os.environ.get("MINERU_LANG", "ch")
POLL_INTERVAL = float(os.environ.get("MINERU_POLL_INTERVAL", "1.0"))
MAX_WAIT = float(os.environ.get("MINERU_MAX_WAIT", "600"))
CUSTOM_CSS = """
.result-panel { min-height: 400px; }
.status-panel { min-height: 200px; font-size: 13px; }
"""
async def discover_api(client: httpx.AsyncClient) -> str:
"""探测实际可用的 API 前缀: /file_parse 端点"""
@@ -191,11 +196,7 @@ async def process_pdf(file_obj, backend, lang, progress=gr.Progress()):
# Gradio UI
# ---------------------------------------------------------------------------
def create_ui():
custom_css = """
.result-panel { min-height: 400px; }
.status-panel { min-height: 200px; font-size: 13px; }
"""
with gr.Blocks(css=custom_css, title="MinerU ROCm — Document Parser") as demo:
with gr.Blocks(title="MinerU ROCm — Document Parser") as demo:
gr.Markdown("""
# MinerU ROCm — Document Parser
@@ -256,4 +257,5 @@ if __name__ == "__main__":
server_name=server_name,
server_port=server_port,
share=False,
css=CUSTOM_CSS,
)