x
This commit is contained in:
@@ -23,6 +23,11 @@ DEFAULT_LANG = os.environ.get("MINERU_LANG", "ch")
|
|||||||
POLL_INTERVAL = float(os.environ.get("MINERU_POLL_INTERVAL", "1.0"))
|
POLL_INTERVAL = float(os.environ.get("MINERU_POLL_INTERVAL", "1.0"))
|
||||||
MAX_WAIT = float(os.environ.get("MINERU_MAX_WAIT", "600"))
|
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:
|
async def discover_api(client: httpx.AsyncClient) -> str:
|
||||||
"""探测实际可用的 API 前缀: /file_parse 端点"""
|
"""探测实际可用的 API 前缀: /file_parse 端点"""
|
||||||
@@ -191,11 +196,7 @@ async def process_pdf(file_obj, backend, lang, progress=gr.Progress()):
|
|||||||
# Gradio UI
|
# Gradio UI
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
def create_ui():
|
def create_ui():
|
||||||
custom_css = """
|
with gr.Blocks(title="MinerU ROCm — Document Parser") as demo:
|
||||||
.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:
|
|
||||||
gr.Markdown("""
|
gr.Markdown("""
|
||||||
# MinerU ROCm — Document Parser
|
# MinerU ROCm — Document Parser
|
||||||
|
|
||||||
@@ -256,4 +257,5 @@ if __name__ == "__main__":
|
|||||||
server_name=server_name,
|
server_name=server_name,
|
||||||
server_port=server_port,
|
server_port=server_port,
|
||||||
share=False,
|
share=False,
|
||||||
|
css=CUSTOM_CSS,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user